Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I wish this was in VFP and not VB.....
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00519713
Message ID:
00520454
Views:
25
>>#DEFINE NumberOfPagesToInsert AcroExchInsertPDDoc.GetNumPages()
>Appreciate you showing this. Can VFP procedures (methods) also be called? Can parameters be passed? I know - an apogee of sloth.
>Thanks
>Terry

#DEFINE's are string translations that take place at compile-time not run-time. That is, when PRG's etc. are converted into FXP's or EXE's etc.

A #DEFINE can contain almost anything. I often use them to make code self documenting, here is a simplified example
#DEFINE Sunday 1
#DEFINE Saturday 7
#DEFINE IsAWeekend   INLIST( iDayOfWeek, Saturday, Sunday )

iDayOfWeek = DOW( dCurrent )
IF NOT (IsAWeekend) THEN
   *-
   *- Do some processing.
   *-
ENDIF
Admitedly, in this contrived example, one could argue that readability has suffered because it is no longer obvious that iDayOfWeek is part of the test. But in real life, typically the data being tested is obvious and the expressions much more complex.

Hope this helps.
censored.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform