Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code within a template
Message
 
To
07/04/2002 18:30:34
General information
Forum:
Visual FoxPro
Category:
West Wind Web Connection
Miscellaneous
Thread ID:
00642000
Message ID:
00642009
Views:
14
You should not use LOCAL in scripts or templates because those are actually translated into PRIVATEs. This is necessary for the code to run in CodeBlock since it won't be able to see LOCALs between the parsing of the function.

LOCAL ARRAY will definitiely fail because there's no such thing as PRIVATE ARRAY, so just don't use LOCAL on arrays.

+++ Rick ---

>In a template, I have the following code:
>
>
>< % ERROR: 
>LOCAL lcHtml,lnLength
>lnLength=5
>IF glSysop
>   lnLength=11
>ENDIF
>LOCAL ARRAY laMenu[lnLength,2]
>lcHtml=''
>...
>RETURN lcHtml
> % >
>
>
>However, if I do this:
>
>
>< % ERROR: 
>LOCAL lcHtml
>IF glSysop
>   LOCAL ARRAY laMenu[11,2]
>   ELSE
>   LOCAL ARRAY laMenu[5,2]
>ENDIF
>lcHtml=''
>...
>RETURN lcHtml
> % >
>
>
>it never works. Anyone know why?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform