NeoBook includes a number of predefined Global Variables which include things like the current date/time, window size, etc. NeoAppBuilder will have something similar, but I wanted to get your input on two things:
1. Since the term "Global Variable" has a somewhat different meaning in JavaScript, should we call our global variables something else to avoid confusion? For example:
System Variables
Static Variables
Predefined Variables
Special Variables
or ???
2. To avoid conflicts with user-defined variables, should we add some type of prefix to global variables. For example, instead of [Time] we would use:
[#Time]
It doesn't matter that "#" is not a valid character for JavaScript variable names, since global variable names are simply place holders and are replaced by NeoAppBuilder's compiler. Using # as a prefix would work well since we use that for the special Unicode/ASCII code variables like [#13]. This makes sense for consistency, but is a departure from NeoBook methods.
Question About Global Variables
Moderator: Neosoft Support
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Question About Global Variables
NeoSoft Support
Re: Question About Global Variables
Dave:
Thanks for asking ... here is MHO ...
1) In declining order of preference ...
Predefined Variables
Special Variables
System Variables
2) As an alternative ... assuming NeoSoftAppBuilder can handle the syntax ... how about something like ...
[NAB.Time]
or
[NAB#Time]
or
[#NAB.Time]
This is predicated by the idea that NeoSoftAppBuilder could also provide corresponding (Global) Javascript variables for the developer's convenience ... in which case, taking advantage of Javascript's Object (JSON) facilities, the variables could be contained (as key/value pairs) in a single object ... so they could be accessed like ...
NAB.Time
NAB.ScreenWidth
etc. etc.
So, as a developer, all your "predefined variables" are in similarly named "objects" ... and accessible from NeoSoft or Javascript commands.
</MHO>
Thanks for asking ... here is MHO ...
1) In declining order of preference ...
Predefined Variables
Special Variables
System Variables
2) As an alternative ... assuming NeoSoftAppBuilder can handle the syntax ... how about something like ...
[NAB.Time]
or
[NAB#Time]
or
[#NAB.Time]
This is predicated by the idea that NeoSoftAppBuilder could also provide corresponding (Global) Javascript variables for the developer's convenience ... in which case, taking advantage of Javascript's Object (JSON) facilities, the variables could be contained (as key/value pairs) in a single object ... so they could be accessed like ...
NAB.Time
NAB.ScreenWidth
etc. etc.
So, as a developer, all your "predefined variables" are in similarly named "objects" ... and accessible from NeoSoft or Javascript commands.
</MHO>
Re: Question About Global Variables
I do agree with Gaev.
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
http://sinlios.com
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: Question About Global Variables
That's a really interesting idea. I'll look into it further.This is predicated by the idea that NeoSoftAppBuilder could also provide corresponding (Global) Javascript variables for the developer's convenience ...
NeoSoft Support