Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Including a .h file
Message
From
20/06/2001 17:07:44
 
 
To
20/06/2001 09:29:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00521249
Message ID:
00521691
Views:
14
>These are the first lines of my main program.
>


>#include mensajes.h
>public pladmon, plvtas, plcpras, plbcos, plnom, plcontab, plalm, pcmodulo, pcusuario
>store .f. to pladmon, plvtas, plcpras, plbcos, plnom, plcontab, plalm
>


>But when I use the debugger to chechk out the program it skip the first line (#include mensajes.h) and I can not understand why...?
>TIA
>Note: Is there any article about the use of file .h?


Andrews:

Como bien te han explicado Dan y Roi, los archivos .h se incluyen al momento de compilar.

Tu puedes usar #define en un .prg para definir constantes y eso vale sólo para ese .prg. Lo mismo sucede con formularios y clases.

Ej. en .prg:
#define CONSTANTE1 20
#define CONSTANTE2 100

? CONSTANTE1 + CONSTANTE2
Ahora bien, para evitar tener que definir todas tus constantes una y otra vez, las puedes guardar en un archivo .h (como el ejemplo que viene: foxpro.h). Incluyes este archivo y se lee y procesa al momento de compilar.
#include foxpro.h
Como sólo tiene vigencia en es objeto, debes repetirlo en los otros. AL estar creando un formulario (form), verás una opción de Include en el menu de Forms.

HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform