Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCAN and DO WHILE logic
Message
From
28/10/2008 20:06:16
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
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:
01357893
Views:
24
>>>>I'm trying to only keep the first unique value of the GroupHeading field, blanking all others like it until I get to a different value. The code below is kicking out of the DO WHILE because the value of GroupHeading is changed by the REPLACE. I understand why, but how can I get around it?.
>>>>
>>>>			SELECT WorkListXMLCursor
>>>>			SCAN
>>>>				m.GroupHeading = GroupHeading
>>>>				DO WHILE GroupHeading = m.GroupHeading
>>>>					SKIP
>>>>					REPLACE GroupHeading WITH ''
>>>>				ENDDO
>>>>			ENDSCAN
>>>>
>>>
>>>why not replace GroupHeader with "" for GroupHeader = m.GroupHeader ?
>>
>>I'm sorry, but that makes no sense to what I'm trying to do.
>>
>>I start with this in the first field (there are others not listed here):
>>
>> 1 RECEIVER
>> 2 RECEIVER
>> 3 RECEIVER
>> 4 SUBSCRIBER
>> 5 SUBSCRIBER
>> 6 SUBSCRIBER
>> 7 SUBSCRIBER
>> 8 DEPENDENT
>> 9 DEPENDENT
>>10 DEPENDENT
>>11 DEPENDENT
>>12 DEPENDENT
>>
>>And want this:
>>
>> 1 RECEIVER
>> 2 
>> 3 
>> 4 SUBSCRIBER
>> 5 
>> 6 
>> 7 
>> 8 DEPENDENT
>> 9 
>>10 
>>11 
>>12 
>>
>
>I had a similar requirement recently. In other words, you want to update all records except for the record with the minimum record number, correct?
>
>If so, this can be done in one UPDATE statement. Give me a sec.

And I do not want to change the order of any of the records. Not that that likely matters in an UPDATE statement. AND, there could be another set of SUBSCIBER records below DEPENDENT.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform