Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution in a Report?
Message
De
12/04/1999 16:39:11
 
 
À
12/04/1999 16:36:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00207535
Message ID:
00207575
Vues:
14
>>>I have a program that needs to report on information from a table, but the system will not be informed of the layout of the table until runtime. I have tried everything I know to set it up so that the reporting routine works regardles of the name of the fiels using macro susbstitution. So far nothing has worked. Any hints?
>>>
>>>Thanks in advance...
>>>
>>>
>>>John Dennis
>>
>>I guess you may use UDFs. For example, use as field expression "GetMyField1":
>>FUNCTION GetMyField1
>>DO CASE
>>CASE Alias()="TABLE1"
>> Return table1.field5
>>CASE Alias()="TABLE2"
>> Return table2.field8
>>*** etc.
>>ENDCASE
>>
>>Instead of Alias(), you may check something else, e.g. FCOUNT(), whatever is more appropriate for your design, some pre-set variable in ultimate case.
>
>
>Thanks, I will take a look at the udf idea.
>
>jd

Antoher way, maybe simpler to implement in your case, is to move data from tables with different structure to a cursor with fixed structure and then print from this cursor.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform