Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan Hangs on Same Record
Message
From
08/07/2008 11:03:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
08/07/2008 10:58:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01329709
Message ID:
01329712
Views:
12
Probably the LABEL command changes the record pointer. You might save the record pointer before the LABEL command, and restore it later, before the ENDSCAN.

Oh, and please make your code more readable by using the PRE tag. This will maintain spaces, use a fixed-sized font, and turn off word-wrap. Click on "Reply" to see how I created the following sample code:
if (some condition)
    Sample_command
endif
>When I run the following code the Label output never moves past the second record but repeats second record over and over. The SPT returns 5 records. Now if I replace the LABEL line with a MESSAGEBOX if works correctly.
>
>CASE p1 = 6
> getPrintedTSOStringA = "Select Distinct whslc From amflib6.itembl Where (LENGTH(TRIM(itnbr)) < 15 Or RIGHT(itnbr,1) <> 'F') And whslc <> 'REJECT' And vndnr = '" + ALLTRIM(p2) + "' And mohtq <> 0 order By whslc"
>
> IF SQLEXEC(tsoVARS.as400con, getPrintedTSOStringA, "getPrintedTSOQueryA") <> -1 Then
> IF RECCOUNT("getPrintedTSOQueryA") > 0 Then
> SCAN
> tsoVars.whloc = getPrintedTSOQueryA.whslc
> LABEL FORM purchasepartlabels3.lbx PREVIEW &&NOCONSOLE TO Printer
>
> ENDSCAN
>
>
> ELSE
> RETURN .F.
> EndIf
>
> Else
> If Aerror(odbcerrormsg) > 0 Then
> MessageBox(odbcerrormsg(2))
> EndIf
> Return .F.
> ENDIF
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform