Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FOR ... ENDFOR loop
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00552168
Message ID:
00552306
Views:
13
>Hi all,
> I have a group of fields, five in all that I need to go through sequentially. I have a for loop that that I thought would do this. They are named note1 through note5. I am trying to use something along the lines of:
>
>FOR i = 1 to 5
> DO CASE
> CASE note(i)
> myCode
> ENDCASE
>ENDFOR
>
>What is wrong with this picture?
>Thanks

Just add the following line outside your loop
SCATTER FIELDS note1, note2, note3, note3, note4 TO note

or

SCATTER FIELDS LIKE note* tO notes
SCATTER FIELDS LIKE note? tO notes

depending on your pleasure.

Also check out the following functions AFIELDS(), FIELD() for more.

As you can see from the many responses there are many ways to skin the fox.

regards,

costas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform