General information
Category:
Coding, syntax & commands
Title:
Macro expansion help
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only