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:
00102904
Views:
26
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.

>Maybe I'd better explain better what I'm trying to do. It's similar to a multiplication table like you see in grade schools. Running down the left side is 0-9, running across the top is 0-9. If you want to know what 9*9 is, you find 9 on the left, 9 on the top, and where they intersect is 81.
>
>This is the same idea. I have a set of zones. To find the price for a trip, I need to look up what the cost is to go from the first zone to the second zone. In my example above, going from zone 9 to zone 9 costs 81 dollars.
>
>The only other way I could think of is to list every combinations of zones and their prices, but that seems rather tedious.
>
>Did I explain it better?
>
>Thanks,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform