Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compiler directives in ControlSource?
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00872778
Message ID:
00872853
Vues:
17
Eric,

VFP doesn't process preprocessor directives for the properties because properties aren't compiled. You can assign controlsources of the controls in the Init of the form instead of in the Properties sheet. This way "#DEFINE statements will be applied.
Thisform.text1.controlsource = [Thisform.S_data(ccn)]
>1. Is there any way to have a controlsource of a control be an array element where the array element number is a compiler directive #define'd text? In other words, "s_data(ccn)" where the .h file has a line "#DEFINE ccn 2" instead of "s_data(2)"?
>
>This is old app being converted which used scatter/gather to arrays and used the "named" array elements instead of numbers.
>When the .spr tries to "do form", I get an error
>"Object: ERROR LOADING FILE - RECORD NUMBER 25. TXTS_DATACCN19 -OR ONE OF ITS MEMBERS>. CONTROLSOURCE : VARIABLE 'CCN' IS NOT FOUND, Type: U, Eval:"
>
>If I replace the 'CCN' in the S_data(ccn) ControlSource, the error doesn't occurs at that record number but instead occurs at the next control that has such a controlsource.
>
>2. I thought that during the project or app build, the .h file caused "substitution" of all the #defines. "Shouldn't" the compiler substitute the number 2 for the text "ccn" in that CONTROLSOURCE?
>
>If not, then until (and if) I convert the scatter/gather methodology, is there a way around this or am I going to have to do a whole bunch of strtrans on the .scx memo fields that have those controlsources?
>
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform