TIP: Click on subject to list as thread! ANSI
echo: foxpro
to: DEN BARNES
from: MICHAEL DOUGHERTY
date: 1997-03-14 23:52:00
subject: Scoping Issues

I'm using Foxpro 2.6 on a Win95 platform.
I declare 18 variables to be the numbers 1-18, so i can use meaningful
labels in my code, rather than the numbers.  (this also makes it easy to
change the order certain details are examined)
These 18 name constants are declared PUBLIC in the Setup snippet of the
ScreenBuilder, then initialized to their values.
The screen control (@ GET) calls a procedure, which conditionally calls
another procedure to do the specific work in each case.  When the
working procedure tries to reference the global variable, the procedure
works the first time it is entered- but the second time the procedure is
called, the program halts because the variable (my public constant)
cannot be found.  Debug shows no value just after control passes to the
procedure (the second time)
Is there a scoping restriction that makes variables available only to
immediate child procedures, but not grandchildren?  Is there a way
around this, without actually passing 18 extra parameters?  (possibly
something like VBa (Excel 5.0) "ParamArray")
--- PCBoard (R) v15.3 (OS/2) 5
---------------
* Origin: Yardley, PA (1:273/239)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.