Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a 'grid' table
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00102892
Message ID:
00102928
Views:
25
>>Michelle,
>>
>>You could create a CREATE CURSOR command in a memory variable, then run the memory variable using macro expansion.
>>
>>Something like this:
>>
>>m.lcCommand='CREATE CURSOR MyCursor('
>>FOR i=1 TO lnNumFields
>> m.lcCommand=m.lcCommand+'Field'+LTRIM(STR(i))+'N(6,2)'
>>NEXT i
>>
>>m.lcCommand=m.lcCommand+')'
>>RUN &lcCommand
>>
>>You'd need to fix up the CREATE CURSOR syntax, but this is the general idea.
>
>
>I'm afraid this has me completely baffled. What does this do?
>
>Thanks,

Michelle,

It creates a cursor (you could use CREATE TABLE instead to create a table) with i fields named Field1-Fieldi. You can substitute whatever you want for the field naming. It's really just a way to create a cursor in code when the number of fields and there names aren't known until run-time.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform