|
-
Dec 31st, 1999, 11:18 AM
#1
Thread Starter
Lively Member
Hi, look at the code below...Sub cmdGet()
N = 0
Dim ret As Long
Dim Temp As String * 100
Do Until ret <= 1
N = N + 1
ret = GetPrivateProfileString(AppName, "n" & N, vbNull, Temp, Len(Temp), FlName)
If ret <= 1 Then
GoTo nextn
Else
Sleeping.List1.AddItem Trim(Temp)
End If
nextn:
Loop
End Sub
then the sub doesn't work. and when i replace the Do with the For statement it works. can anybody show me what's wrong...
-
Dec 31st, 1999, 05:47 PM
#2
RET is immediately less than 1, so it never executes!!!
when you Dim a new variable, it sets it to 0.
theres your problem.
if you want it to execute at least once, put the Until ret <=1 next to the loop word
-
Jan 2nd, 2000, 11:52 AM
#3
Thread Starter
Lively Member
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
|