StorageSet Method (CLIENT)


PLB Web Only, 9.8A

 

The StorageSet method creates HTML5 localStorage objects', HTML5 sessionStorage objects, and browser cookie data. The method uses the following format:

 

[label]

{object}.StorageSet

[GIVING {return}] using [*Key=]{key}[:

 

 

[*Value=]{value}][,[*Options=]{mask}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A CLIENT object.

return

Optional. A Numeric Variable that receives a pass or fail value for the method execution.

key

Required. A Character String Variable or literal that specifies the keyword name string.

value
Optional. A Character String Variable or literal that specifies the string value to be stored for the {keyname} at the client browser.
mask
Optional. A Character String Variable or literal that specifies the string value to be stored for the {keyname} at the client browser.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The HTML5 storage objects can store PL/B Web program data at the browser using the StorageSet method. The data can then be retrieved at a later time or in another browser session using the StorageGet method. This method uses a keyword to fetch data from the browser storage. See the following links for more information on the HTML5 storage objects:

  2.  

    http://www.w3schools.com/html/html5_webstorage.asp

     

  3. The ZERO flag is set if the {return} value is zero.

  4. The OVER flag is set if the {return} variable is too small where the returned value is truncated.

  5. The EOS flag is always cleared.

  6. The {mask} values are defined as follows:

  7.  

    Value

    Definition

    0

    The default action by this method occurs when the *OPTIONS parameter is set to zero or when this parameter is not used. The default method operation is to use the browser 'localStorage object'.

    1

    This bit value causes this method to perform the operation using the browser 'sessionStorage object'.

    2

    This bit value causes this method to perform the operation using a browser storage cookie.

     

  8. If the {value} parameter is not specified when this method executes, the {keyname} is removed from the browser using the specific {keyname} for a storage object type.

 

 

See Also: CLIENT, Client Methods, Method Syntax



PL/B Language Reference StorageGet Method (CLIENT)