Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCAN and DO WHILE logic
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01357888
Message ID:
01358057
Views:
24
>>I think your logic is wrong. If you skip within the Do While, before the Replace, the first record with the *next* GroupHeading will be blanked. Try this.
>>
>>
>>LOCAL m.FirstTime, m.CurrentGroupHeading
>>m.FirstTime = .T.
>>
>>SELECT WorkListXMLCursor
>>SET ORDER TO TAG GroupHeading    && or whatever it's called
>>m.CurrentGroupHeading = GroupHeading
>>
>>SCAN
>>    *  Never replace the first record
>>    IF m.FirstTime
>>       m.FirstTime = .F.
>>       LOOP
>>    ENDIF
>>    IF GroupHeading = m.CurrentGroupHeading
>>        REPLACE GroupHeading WITH ''
>>    ELSE
>>        m.CurrentGroupHeading = GroupHeading
>>    ENDIF
>>ENDSCAN
>>
>>
>>Untested....
>
>I'm wondering why you all keep suggesting untested ideas while this thread has a simple solution already?

Sorry, I didn't read all the replies. I see your solution is the same as mine -- actually a little simpler because no extra variable to keep track of first-time-through.

So today is Naomi Nosonovsky Day on the UT. All praise her!!!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform