Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro expansion help
Message
From
04/01/2000 11:37:27
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Macro expansion help
Miscellaneous
Thread ID:
00312467
Message ID:
00312467
Views:
54
Is there another (better) way to do the following:

sele (megatable_of_data)
Scan
** pub=["AAA"|"BBB"|"CCC"|"DDD"]
** filestru= table (PUB C(3), OutStru M, InFields M, InVals M)
..sele filestru
..seek (megatable_of_data.pub)
..If !found()
....seek "ZZZ" (table entry for a generic structure)
..endif

..field_list = filestru.Infields
..value_list = filestru.InVals
..output_filename = (path) + "Ofc_" + (filestru.pub)

..Insert Into (output_filename) &field_list VALUES &value_list

..sele (megatable_of_data)
EndScan

Conditions/Thoughts:
The InFields (memo) values are meticulously entered so that the string of fields corresponds to the string of values in the InVals (memo) field. (including the parenthesis required by the Insert command.

I didn't want to do multiple Select-SQL on a large-ish table, esp. since the output files cannot be overwritten (which would require the sql results to be appended to the existing files= 2+ steps per pub)
I didn't want to hard-code the structure for each PUB value, because a table-based pub list would be easier to add to.
This logic is working perfectly in one of four installations so far. I would like to know why it DOESN'T work in the remaining 3 offices. What am I missing? TIA
Next
Reply
Map
View

Click here to load this message in the networking platform