Child pages
  • JSVariable

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#DATETIME]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#INTEGER]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#MEDIA]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#NUMBER]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#TEXT]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#defaultValue]
The default value of the variable.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#name]
The name of the variable.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#variableType]
The type of the variable.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\()
Returns the UUID of the variable{td}{tr}{tbody}{table}\\ 

{table:id=constant|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=DATETIME|class=node}{tr:id=name}{td}h6.DATETIME{td}{tr}{tr:id=des}{td}{sub-section:DATETIME_des|text=|trigger=button}{sub-section}{sub-section:DATETIME_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:DATETIME_snc|text=|trigger=button}{sub-section}{sub-section:DATETIME_snc|trigger=none|class=sIndent} Replace with version info{sub-section} Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prsret}{td}*ParametersReturns*\\{sub-section:DATETIME_prs|text=|trigger=button}{sub-section}{sub-section:DATETIME_prs|trigger=none|[Number]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{sub-sectiondiv}{td}{tr}{builder-show}{tr:id=retlink}{td}*ReturnsExternal links*\\{sub-section:DATETIME_ret|text=|trigger=button}{sub-section}{sub-section:DATETIME_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{div:class=sIndent}{div}{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:DATETIME_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DATETIME_see|trigger=none}{sub-sectioncode:language=javascript}
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(globals.gDate); // Prints the current date and time.
{code}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linktr:class=lastDetailRow}{td}{td}*External links*\\{sub-section:DATETIME_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DATETIME_link|trigger=none}{sub-section}{div}{tr}{tbody}{tbody:id=INTEGER|class=node}{tr:id=name}{td}h6.INTEGER{td}{tr}{builder-show}{tr:id=samdes}{td}*Sample*\\{sub-section:DATETIME_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DATETIME_sam|trigger=none}{code:language=javascript}
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(globals.gDate); // Prints the current date and time.
{code}{sub-section}{div}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:classid=lastDetailRowprs}{td}*Parameters*\\{td}{tr}{tbody}{tbody:id=INTEGER|class=node}{tr:id=name}{td}h6.INTEGERtr:id=ret}{td}*Returns*\\[Number]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=deslink}{td}{sub-section:INTEGER_des|text=|trigger=button}{sub-section}{sub-section:INTEGER_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:INTEGER_snc|text=|trigger=button}{sub-section}{sub-section:INTEGER_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{div:class=sIndent}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(globals.gInt); // Prints 997
{code}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prstr:class=lastDetailRow}{td}{td}*Parameters*\\{sub-section:INTEGER_prs|text=|trigger=button}{sub-section}{sub-section:INTEGER_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show{tr}{tbody}{tbody:id=MEDIA|class=node}{tr:id=name}{td}h6.MEDIA{td}{tr}{tr:id=retdes}{td}*Returns*\\{sub-section:INTEGER_ret|text=|trigger=button}{sub-section}{sub-section:INTEGER_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=editConstant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=seeret}{td}*Also seeReturns*\\{sub-section:INTEGER_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INTEGER_see|trigger=none}{sub-section}{[Number]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:INTEGER_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INTEGER_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{trtr:id=sam}{td}*Sample*\\{sub-section:INTEGER_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INTEGER_sam|trigger=none}{code:language=javascript}
var intVarmediaVar = solutionModel.newGlobalVariable('gIntgMedia', JSVariable.INTEGERMEDIA);
intVarmediaVar.defaultValue = 997 'new Array(1, 2, 3, 4)';
application.output(globals.gIntgMedia); // Prints 997
{code}{sub-sectionout the array with four elements.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=MEDIANUMBER|class=node}{tr:id=name}{td}h6.MEDIANUMBER{td}{tr}{tr:id=des}{td}{sub-section:MEDIA_des|text=|trigger=button}{sub-section}{sub-section:MEDIA_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:MEDIA_snc|text=|trigger=button}{sub-section}{sub-section:MEDIA_snc|trigger=none|class=sIndent} Replace with version info{sub-section} Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prsret}{td}*ParametersReturns*\\{sub-section:MEDIA_prs|text=|trigger=button}{sub-section}{sub-section:MEDIA_prs|trigger=none|[Number]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{sub-sectiondiv}{td}{tr}{builder-show}{tr:id=retlink}{td}*ReturnsExternal links*\\{sub-section:MEDIA_ret|text=|trigger=button}{sub-section}{sub-section:MEDIA_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{div:class=sIndent}{div}{td}{tr}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:MEDIA_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:MEDIA_see|trigger=none}{sub-sectioncode:language=javascript}
var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(globals.gNumber); // Prints 192.334
{code}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:MEDIA_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:MEDIA_link|trigger=none}{sub-section}{div}{td}{tr}{builder-showtr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=TEXT|class=node}{tr:id=name}{td}h6.TEXT{td}{tr}{tr:id=samdes}{td}*Sample*\\{sub-section:MEDIA_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:MEDIA_sam|trigger=none}{code:language=javascript}
var mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(globals.gMedia); // Prints out the array with four elements.
{code}{sub-section}{div}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:classid=lastDetailRowret}{td}*Returns*\\[Number]{td}{tr}{tbody}{tbodytr:id=NUMBER|class=node}{tr:id=name}{td}h6.NUMBERsee}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=deslink}{td}{sub-section:NUMBER_des|text=|trigger=button}{sub-section}{sub-section:NUMBER_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:NUMBER_snc|text=|trigger=button}{sub-section}{sub-section:NUMBER_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:NUMBER_prs|text=|trigger=button}{sub-section}{sub-section:NUMBER_prs|trigger=none|class=sIndent}{sub-sectiondiv:class=sIndent}{code:language=javascript}
var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value.
application.output(globals.gText); // Prints 'some text' (without quotes).
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{builder-showtbody}{tr:id=ret}{td}*Returns*table}\\{sub-section:NUMBER_ret|text=|trigger=button}{sub-section}{sub-section:NUMBER_ret|trigger=none|class=sIndent}[Number]{sub-section}{td 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{builder-show:permission=edittbody:id=defaultValue|class=node}{tr:id=seename}{td}*Also see*\\{sub-section:NUMBER_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:NUMBER_see|trigger=none}{sub-section}{div}{h6.defaultValue{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkdes}{td}*External links*\\{sub-section:NUMBER_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:NUMBER_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:NUMBER_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:NUMBER_sam|trigger=none}{code:language=javascript}
var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(globals.gNumber); // Prints 192.334
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=TEXT|class=node}{tr:id=name}{td}h6.TEXT{td}{tr}{tr:id=des}{td}{sub-section:TEXT_des|text=|trigger=button}{sub-section}{sub-section:TEXT_des|trigger=none|class=sIndent}Constant to be used when the type of a variable needs to be specified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:TEXT_snc|text=|trigger=button}{sub-section}{sub-section:TEXT_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:TEXT_prs|text=|trigger=button}{sub-section}{sub-section:TEXT_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:TEXT_ret|text=|trigger=button}{sub-section}{sub-section:TEXT_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:TEXT_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:TEXT_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:TEXT_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:TEXT_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:TEXT_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:TEXT_sam|trigger=none}{code:language=javascript}
var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value.
application.output(globals.gText); // Prints 'some text' (without quotes).
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=defaultValue|class=node}{tr:id=name}{td}h6.defaultValue{td}{tr}{tr:id=des}{td}{sub-section:defaultValue_des|text=|trigger=button}{sub-section}{sub-section:defaultValue_des|trigger=none|class=sIndent}The default value of the variable. 

It is interpreted as a JS expression.

For INTEGER variables it can be an integer constant, like 10 for example.
For NUMBER variables it can be a real constant, like 22.41. For DATETIME
variables it can be "now", or a JS expression like "new Date()". For TEXT 
variables it can be any string surrounded with quotes, like 'some text'.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:defaultValue_snc|text=|trigger=button}{sub-section}{sub-section:defaultValue_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:defaultValue_prs|text=|trigger=button}{sub-section}{sub-section:defaultValue_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:defaultValue_ret|text=|trigger=button}{sub-section}{sub-section:defaultValue_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:defaultValue_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:defaultValue_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:defaultValue_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:defaultValue_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:defaultValue_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:defaultValue_sam|trigger=none}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(globals.gInt); // Prints 997
var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(globals.gNumber); // Prints 192.334
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(globals.gDate); // Prints the current date and time.
var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value.
application.output(globals.gText); // Prints 'some text' (without quotes).
var mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(globals.gMedia); // Prints out the array with four elements.
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=name|class=node}{tr:id=name}{td}h6.name{td}{tr}{tr:id=des}{td}{sub-section:name_des|text=|trigger=button}{sub-section}{sub-section:name_des|trigger=none|class=sIndent}The name of the variable.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:name_snc|text=|trigger=button}{sub-section}{sub-section:name_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:name_prs|text=|trigger=button}{sub-section}{sub-section:name_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:name_ret|text=|trigger=button}{sub-section}{sub-section:name_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:name_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:name_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{The default value of the variable. 

It is interpreted as a JS expression.

For INTEGER variables it can be an integer constant, like 10 for example.
For NUMBER variables it can be a real constant, like 22.41. For DATETIME
variables it can be "now", or a JS expression like "new Date()". For TEXT 
variables it can be any string surrounded with quotes, like 'some text'.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[String]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{sub-section:name_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:name_link|trigger=none}{sub-sectiondiv:class=sIndent}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:name_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:name_sam|trigger=none}{code:language=javascript}
var gVardiv:class=sIndent}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(globals.gInt); // Prints 997
var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(globals.gNumber); // Prints 192.334
var dateVar = solutionModel.newGlobalVariable('gtextgDate', JSVariable.TEXT);
gVar.name = 'anotherName';
gVar.DATETIME);
dateVar.defaultValue = 'now';
application.output(globals.gDate); // Prints the current date and time.
var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT);
txtVar.defaultValue = '"defaultsome text"'; // Use two Thepairs nextof twoquotes linesif willyou printwant theto sameassing output.
application.output(globals[gVar.name]);
application.output(globals.anotherName);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=variableType|class=node}{tr:id=name}{td}h6.variableType{td}{tr}{tr:id=des}{td}{sub-section:variableType_des|text=|trigger=button}{sub-section}{sub-section:variableType_des|trigger=none|class=sIndent}The type of the variable. Can be one of: TEXT, INTEGER, NUMBER, DATETIME or MEDIA.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:variableType_snc|text=|trigger=button}{sub-section}{sub-section:variableType_snc|trigger=none|class=sIndent} Replace with version info{sub-sectiona String as default value.
application.output(globals.gText); // Prints 'some text' (without quotes).
var mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(globals.gMedia); // Prints out the array with four elements.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{builder-showtbody}{builder-show:permission=edittbody:id=name|class=node}{tr:id=prsname}{td}*Parameters*\\{sub-section:variableType_prs|text=|trigger=button}{sub-section}{sub-section:variableType_prs|trigger=none|class=sIndent}{sub-section}h6.name{td}{tr}{tr:id=des}{td}The name of the variable.{td}{tr}{builder-show}{tr:id=retsnc}{td}*ReturnsSince*\\{sub-section:variableType_ret|text=|trigger=button}{sub-section}{sub-section:variableType_ret|trigger=none|class=sIndent}[Number]{sub-section} Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{builder-showtr:permission=editid=ret}{td}*Returns*\\[String]{td}{tr}{tr:id=see}{td}*Also see*\\{sub-section:variableType_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:variableType_see|trigger=none}{sub-sectiondiv:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linksam}{td}*External linksSample*\\{sub-section:variableType_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:variableType_link|trigger=none}{sub-sectiondiv:class=sIndent}{code:language=javascript}
var gVar = solutionModel.newGlobalVariable('gtext', JSVariable.TEXT);
gVar.name = 'anotherName';
gVar.defaultValue = '"default text"';
// The next two lines will print the same output.
application.output(globals[gVar.name]);
application.output(globals.anotherName);
{code}{div}{td}{tr}{builder-show}{tr:idclass=samlastDetailRow}{td}*Sample*\\{sub-section:variableType_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:variableType_sam|trigger=none}{code:language=javascript}
var g = solutionModel.newGlobalVariable('gtext',JSVariable.TEXT);
globals.gtext = 'some text';
g.variableType = JSVariable.DATETIME;
globals.gtext = 'another text'; // This will raise an error now, because the variable is not longer of type text.
{code}{sub-section}{div}{td}{tr}{tbody}{tbody:id=variableType|class=node}{tr:id=name}{td}h6.variableType{td}{tr}{tr:id=des}{td}The type of the variable. Can be one of: TEXT, INTEGER, NUMBER, DATETIME or MEDIA.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:classid=lastDetailRowret}{td}*Returns*\\[Number]{td}{tr}{tbodytr:id=see}{tabletd}*Also see*\\ 

{tablediv:id=function|class=servoy sDetailsIndent}{div}{td}{colgrouptr}{columntr:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getUUID|class=node}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){spanid=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var g = solutionModel.newGlobalVariable('gtext',JSVariable.TEXT);
globals.gtext = 'some text';
g.variableType = JSVariable.DATETIME;
globals.gtext = 'another text'; // This will raise an error now, because the variable is not longer of type text.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tr:id=des{tbody}{tdtable}{sub-section:getUUID_des|text=|trigger=button}{sub-section}{sub-section:getUUID_des|trigger=none|class=sIndent}Returns the UUID of the variable{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUUID_snc|text=|trigger=button}{sub-section}{sub-section:getUUID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getUUID|class=node}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=prssig}{td}*Parameters*\\{sub-section:getUUID_prs|text=|trigger=button}{sub-section}{sub-section:getUUID_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUUID_ret|text=|trigger=button}{sub-section}{sub-section:getUUID_ret|trigger=none|class=sIndent}[UUID]{sub-section}{td}{tr}{builder-show:permission=edit{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}Returns the UUID of the variable{td}{tr}{tr:id=seesnc}{td}*Also seeSince*\\{sub-section:getUUID_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUUID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[UUID]{td}{tr}{tr:id=linksee}{td}*ExternalAlso linkssee*\\{sub-section:getUUID_link|text=|trigger=button}{sub-section}div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{sub-section:getUUID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUUID_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUUID_sam|trigger=none}{code:language=javascript}
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
application.output(dateVar.getUUID().toString());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}