Qenv()

Read(1544) Label: qvs, global variable,

Description:

Set or get global variable for/from QVS.

Syntax:

Qenv(v,x)

Note:

The function sets global variable v, and assigns value x to it.

 

In the QVS application, global variables are public and a script file can invoke any global variable.

 

Will be parsed as env() function when the controller QVS isn’t configured.

Parameter:

v

Global variable name

x

Global variable value

Return value:

Global variable value

Example:

Ø  Set global variable for QVS

Create setEnv.splx and upload the file to storage bucket qtc01 in cloud storage platform S3:

 

A

 

1

=Qenv("gvar1","Sale")

Set value of global variable gvar1 as Sale.

Execute script file setEnv.splx through QVS:

 

A

 

1

=Qconnect("http://54.213.221.123:8080/qvs":"aws-qvs",30,300)

Connect to QVS service.

2

=A1.exec@x("qtc01/setEnv.splx";100)

Execute script file setEnv.splx on the cloud storage through QVS.

 

Ø  Get global variable from QVS

Create getEnv.splx and upload the file to storage bucket qtc01 in cloud storage service S3:

 

A

 

1

=Qenv("gvar1")

Get value of global variable gvar1.

2

=Qfile("qtc01/Employees.txt")

Get Employees.txt stored in the cloud storage.

3

=A2.import@t()

Retrieve content of A2’s file.

4

=A3.select(Post:A1)

Use global variable to get records where Post value is Sale.