SetValueBlob
Description
Sets the blob value for a key. If the key does not exist, then
create the key and set its value. If the key already exists, then
overwrite the value of this key. If more than one key with the same name
already exists, then overwrite the value of the first key. Notice that the
IgnoreCase property (true by default) determines whether the key name will
be matched in a case-sensitive manner.
Applies to
Syntax
|
1 |
objectname.SetValueBlob ( Key, Value ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the JSONPackage object. |
|
Key |
A string specifying the key name. |
|
Value |
A blob specifying the key value. |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, the method returns null.
Examples
This example sets the value of the picturepath key to
A:Document4DPowerBuilder Pictureimagesstartup.BMP
|
1 2 3 4 5 6 7 8 9 10 11 |
// Integer SetValueBlob (string Key, blob Value) String ls_PicturePath JsonPackage ljpk_User ljpk_User = Create JsonPackage // Loads the JSON string to the JSONPackage object ljpk_User.loadstring( '{"id":100,"name":"Henry.Ken","birthday":"1998-01-01","picturepath":"QTpcV29ya0RvY3VtZW50XFVwZ3JhZGVc5Zu+54mHXGF1dG9ydW4uQk1Q" }') // Sets the key value and uses the UTF8 encoding. ljpk_User.SetValueBlob( "picturepath", Blob("A:Document4DPowerBuilder Pictureimagesstartup.BMP",EncodingUTF8!)) // Gets the key value: A:Document4DPowerBuilder Pictureimagesstartup.BMP ls_PicturePath = String(ljpk_User.GetValueBlob("picturepath"),EncodingUTF8!) |
See also