I can define a runtime global variable array
globals.dataset = new Array();
Can this also be done through “Define DataProviders” ?
if so, what “type” would the global need to be?
thanks
greg
I can define a runtime global variable array
globals.dataset = new Array();
Can this also be done through “Define DataProviders” ?
if so, what “type” would the global need to be?
thanks
greg
You need to define it as MEDIA.
Also, would it make any sense to define all my globals as “runtime” globals, in one “opener” method, and not bother with “Define Dataproviders” at all?
Defining them all in one method would help me keep track
greg
gdurniak:
Also, would it make any sense to define all my globals as "runtime" globals, in one “opener” method, and not bother with “Define Dataproviders” at all?Defining them all in one method would help me keep track
greg
Can you please more specific about “runtime globals”?
He means instead of defining the global in dataproviders simply write a method that will initialize a global for example as
globals.myGlobal = 1;
or even
myGlobal = 1;
The problem is that you cannot provide a type (it will always be a media) and that you cannot use it on any form.
gdurniak:
Also, would it make any sense to define all my globals as “runtime” globals, in one “opener” method, and not bother with “Define Dataproviders” at all?Defining them all in one method would help me keep track
Not sure what is easier, your one method or Servoy’s dataproviders window.
Only reason not to use runtime defined globals is when you need to use them as dataproviders in fields or relationships, etc.
Servoy uses javascript for scripting.
And in javascript we are using only the variant datatype.
By declaring the variable as variant, then you can assign any data type value to it. it dose not matter.
that you cannot use it on any form.
You can use that variable in any form, but make sure that your are initializing the global prior to using.
Hope it helps.
You can use that variable in any form, but make sure that your are initializing the global prior to using.
And how do you assign the dataprovider to a field? And as Robert stated, you cannot use it in relations as well. I think, defining globals in dataproviders is preferable and easier to overview. It also integrates better with the standard functionality of Servoy.
I think, defining globals in dataproviders is preferable and easier to overview. It also integrates better with the standard functionality of Servoy.
Yes, sure.