AVSAVEVALUE Function

RAMP-TS

AVSAVEVALUE Function

Saves an alphanumeric or numeric value onto the VLF virtual clipboard.

Syntax

AVSAVEVALUE(vValue, sID1, sID2, sID3, iInstance, sLanguage, bPersist)

Parameters

vValue

Required. Alphanumeric or numeric value to save to the virtual clipboard. 

If this parameter is a JavaScript variable of type string, then the value is posed to the clipboard as an alphanumeric value and can therefore can only be sensibly be retrieved using the AVRESTOREAVALUE function (or equivalent). 

If it is of type number it is posted as type numeric to the clipboard and can only be sensibly retrieved using the AVRESTORENVALUE function (or equivalent). 

 

sID1

Required. String that contains the Virtual Clipboard identifier 1.

sID2

Optional. String that contains the Virtual Clipboard identifier 2.

sID3

Optional. String that contains the Virtual Clipboard identifier 3.

iInstance

Optional. Integer that contains the instance number. Defaults to 1 when not specified. Instances are typically used to create lists of clipboard values and usually accompanied by another clipboard value that indicates how many entries currently exist in the list.

sLanguage

Optional. String that contains the language code. Defaults to ALL languages when not specified.

bPersist

Optional. Boolean value that indicates whether or not a saved value should persist beyond the current execution of the RAMP application. Defaults to true. This parameter has no meaning for VLF-WEB RAMP applications because VLF virtual clipboard values never persist in WEB applications.

 

  

Return Value

None

Remarks

  • Use AVSAVEVALUE in your RAMP scripts to save value in the VLF virtual clipboard. More information about the Virtual Clipboard can be found in The Virtual Clipboard in the Framework guide.
  • The posting of clipboard values from RAMP scripts is asynchronous. When you post values they are not physically processed onto the clipboard until your RAMP script completes execution and yields control back to the framework.
  • The virtual clipboard is primarily designed to pass information between RAMP scripts and RDML(X) code executing in filters, command handlers, etc.
  • The virtual clipboard is not primarily designed to pass information between RAMP scripts. The JavaScript objGlobal object is a more efficient way to pass information exclusively between RAMP scripts.
  • When a RAMP script executing in a web browser application posts values onto the virtual clipboard, they need to be sent to the server for subsequent access by RDML(X) code executing in filters or command handlers (because they are executing on the server). This means that the volume of information you place onto the clipboard will impact the amount of information that needs to be transmitted between the client and the server.
  • This request may be handled asynchronously. The consequences of invoking it may not be visible or useable until your currently active RAMP-TS script(s) complete executing and yields control back to the RAMP-TS manager.

 

Examples 

RDMLX code in a filter or command handler to save/restore clipboard values:

 * Save values onto the clipboard

 

Invoke #avFrameworkManager.avSaveValue WithID1(Test) WithID2(EMPNO) FromAValue(("A0090")

Invoke #avFrameworkManager.avSaveValue WithID1(Test) WithID2(SURNAME) FromAValue("FRED")

Invoke #avFrameworkManager.avSaveValue WithID1(Test) WithID2(GIVENAME) FromAValue("BLOGGS")

Invoke #avFrameworkManager.avSaveValue WithID1(Test) WithID2(POSTCODE) FromNValue(2150)

Invoke #avFrameworkManager.avSaveValue WithID1(Test) WithID2(SALARY) FromNValue(123456.78)

  

* Restore values from the clipboard

  

Invoke #avFrameworkManager.avRestoreValue WithID1(Test) WithID2(EMPNO) ToAValue(#EMPNO) UseAValueDefault("NA")

Invoke #avFrameworkManager.avRestoreValue WithID1(Test) WithID2(SURNAME) ToAValue(#SURNAME) UseAValueDefault("NA")

Invoke #avFrameworkManager.avRestoreValue WithID1(Test) WithID2(GIVENAME) ToAValue(#GIVENAME) UseAValueDefault("NA")

Invoke #avFrameworkManager.avRestoreValue WithID1(Test) WithID2(POSTCODE) ToNValue(#PostCode) UseNValueDefault(0)

Invoke #avFrameworkManager.avRestoreValue WithID1(Test) WithID2(SALARY) ToNValue(#Salary) UseNValueDefault(0)

  

 

RAMP JavaScript code to perform the equivalent operations: 

 

/* Save values onto the clipboard – note POSTCODE and SALARY are numeric */

 

AVSAVEVALUE("A0090","TEST","EMPNO");

AVSAVEVALUE("FRED","TEST","SURNAME");

AVSAVEVALUE("BLOGGS","TEST","GIVENAME");

AVSAVEVALUE(2150,"TEST","POSTCODE");

AVSAVEVALUE(123456.78,"TEST","SALARY");

 

/* Restore values from the clipboard */

 

 

  var vEMPNO    = AVRESTOREAVALUE("NA","TEST","EMPNO");

  var vSURNAME  = AVRESTOREAVALUE("NA","TEST","SURNAME");

  var vGIVENAME = AVRESTOREAVALUE("NA","TEST","GIVENAME");

  var vPOSTCODE = AVRESTORENVALUE(0,"TEST","POSTCODE");

  var vSALARY   = AVRESTORENVALUE(0,"TEST","SALARY");