|
-
Dec 23rd, 2002, 10:45 AM
#1
Thread Starter
Member
Overflow
Ok well ive seen some programs before where say u load a list into a lsit box and it exceeds a limit it says runtime error or something like that so it doesnt freeze and stuff?Well how would u go about to put something inplace for there to be a limit of 45,000?Thx for the help and any will be appreciated
-
Dec 23rd, 2002, 10:52 AM
#2
Retired VBF Adm1nistrator
Um.
Something like this I'd say
VB Code:
'' in some sub/function somwhere
On Error Goto errHandle
Do Until Eof(1)
Line Input #1, someStrBuff
List1.AddItem someStrBuff
Loop
Exit Sub '' or Exit Function
errHandle:
If Err.Number = whateverTheCorrectErrorNumberIs Then
MsgBox "Runtime Error" & Err.Description, vbCritical
Exit Function
End If
-
Dec 23rd, 2002, 11:11 AM
#3
Lively Member
Not certain if this is exactly what you want to do, but...
VB Code:
'Assuming some data input loop
Do While blnCondition
'Do something
intCount = intCount + 1
If intCount = 45000 Then Err.Raise 6
Loop
This will raise the Overflow error on the occurrance of the 45,000th input entry.
tecnithV -- artisan, artificer, workman, mechanic, architect, or builder
VB6, ASP, HTML, XML, Oracle, Access, MySql, PHP, C++, Etc...
To format your VB code in this forum use tags like this [vbcode] your code here[/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|