DECLARE GLOBAL / EXTERN
Minerva Bello
minervabello at globalcontainerline.com
Tue Jul 31 05:50:12 PDT 2007
Please do not send me this email anymore, I receive it 100 times every
morning and it is causing a lot of problems.
MINERVA BELLO
Brokerage
Global Transportation Services, Inc / Miami
P: 305-471-0115 Ext 106
F: 305-471-0118
minervabello at globalcontainerline.com
-----Original Message-----
From: filepro-list-bounces+munirg=sigmanet.hn at lists.celestial.com
[mailto:filepro-list-bounces+munirg=sigmanet.hn at lists.celestial.com] On
Behalf Of Kenneth Brody
Sent: Friday, July 27, 2007 12:42 PM
To: filePro mailing list
Subject: DECLARE GLOBAL / EXTERN
Note that it is perfectly acceptable to have DECLARE EXTERN in the main
processing, and DECLARE GLOBAL in the CALLed table, as long as you don't use
the variable until you call the table that actually defines it with the
DECLARE GLOBAL. I do this all the time.
Example:
===== Main processing:
::end:
@entsel::show "\{T} - test declare extern/global combo":
::end:
::declare extern MyVariable:
@keyT::' MyVariable = "from input":
::call "called":
::mesgbox "Back in input. MyVariable is '" & MyVariable & "'":
::end:
===== Called processing:
::declare global MyVariable(30,*):
::mesgbox "In called processing":
::MyVariable = "set in called":
::end:
=====
This will run just fine. However, if you uncomment the assignment in the
main prc, you will get the error when the CALL is executed, and the variable
will not take on the (30,*) setting.
In more complex library scenarios, I often have an "init" table with all of
the DECLARE GLOBALs needed by the library, in addition to any required
initializations, which gets called prior to using any of the library
routines themselves.
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap at gmail.com>
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list