Is there anyway to determine the Scope [Public, Private or Local] of a
Variable.

Using Foxpro 8.0 Pro.

Re: Determine Scope of Variables ? by man-wai

man-wai
Fri Jul 01 08:18:04 CDT 2005

Tanveer H. Malik wrote:
> Is there anyway to determine the Scope [Public, Private or Local] of a
> Variable.

Shouldn't you know it when you declare the vars?


--
.~. Might, Courage, Vision. http://www.linux-sxs.org
/ v \
/( _ )\ Linux 2.4.30
^ ^ 9:17pm up 49 days 9:26 load average: 1.21 1.23 1.11

Re: Determine Scope of Variables ? by Ook

Ook
Fri Jul 01 11:06:15 CDT 2005

AFAIK there is not way to do this at runtime. The only thing you can do is
search the code at development time to determine the scope of a variable.


"Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
news:OuK6VsjfFHA.2752@TK2MSFTNGP10.phx.gbl...
> Is there anyway to determine the Scope [Public, Private or Local] of a
> Variable.
>
> Using Foxpro 8.0 Pro.
>
>
>



Re: Determine Scope of Variables ? by Lew

Lew
Fri Jul 01 13:05:25 CDT 2005

Yes. Any variable that is not explicitly declared is private, aka automatic,
everything else has its declared scope. To find and eliminate all undeclared
memvars, run you app with the _vfp.languageoptions = 1.
This concept includes parameters and lparameters statements, the "l"
indicating that the parameters are local. This is why I find the current
convention of using lparameters and the "l' naming convention to accept
parameters redundant and amusing.
-Lew
"Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
news:OuK6VsjfFHA.2752@TK2MSFTNGP10.phx.gbl...
> Is there anyway to determine the Scope [Public, Private or Local] of a
> Variable.
>
> Using Foxpro 8.0 Pro.
>
>
>



Re: Determine Scope of Variables ? by Gene

Gene
Fri Jul 01 14:54:05 CDT 2005

On Fri, 1 Jul 2005 15:44:17 +0500, "Tanveer H. Malik"
<tanmalik@hotmail.com> wrote:

>Is there anyway to determine the Scope [Public, Private or Local] of a
>Variable.
>
>Using Foxpro 8.0 Pro.

What is the point? What is this going to give you, and why would
it be of any use? Are you writing a debugger?

You could try parsing the output of list memory.

Sincerely,

Gene Wirchenko


Re: Determine Scope of Variables ? by David

David
Fri Jul 01 21:42:40 CDT 2005

Tanveer,

public giPublic
private piPrivate
local liLocal

giPublic = 1
piPrivate = 1
liLocal = 1

list memory like * to memvardump.txt noconsole
n = alines( laMemvars, filetostr( "memvardump.txt" ) )
for i = 1 to n
? laMemvars[i]
endfor

--
df - Microsoft MVP FoxPro http://www.geocities.com/df_foxpro

"Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
news:OuK6VsjfFHA.2752@TK2MSFTNGP10.phx.gbl...
> Is there anyway to determine the Scope [Public, Private or Local] of a
> Variable.
>
> Using Foxpro 8.0 Pro.
>
>
>