Salesforce

BufSetAlpha (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

BufSetAlpha (Magic xpa 4.x)

Inserts an Alpha or RTF BLOB variable into a specified position in the BLOB buffer.

Syntax:

BufSetAlpha(variable reference, position, value, storage, length, value as pointer)

Parameters:

variable reference – The reference to the BLOB variable containing the buffer. For example, 'A'VAR

position – The numeric value defining where the conversion result will be placed in the BLOB value.

value – The value to be set.

storage – A numeric value representing a valid storage type in Magic xpa. For a list of storage types, see Magic xpa Storage Types.

length – A numeric value representing the length of the Alpha value.

value as pointer – A logical value indicating if the Alpha value should be written directly to the buffer or as a pointer to the data. If you enter True, Magic xpa sets the BLOB with a pointer to the Alpha value. In this case, the data will consume four bytes of the BLOB in case of 32-bit engine and 8 bytes in case of 64-bit engine.

Use pointers if the buffer should receive a string with no size defined.

Returns:

True when the conversion succeeds. False when the conversion fails.

The function fails when the:

  • Variable reference does not refer to a valid variable identification.

  • Variable reference does not refer to a BLOB variable.

  • Position parameter is a negative value.

Example:

The following example inserts the value 'my-string' to the buffer, starting from the first byte to the ninth byte, followed by two pointers to the 'dynamic-string1' and 'dynamic-string2' strings:

32-bit

BufSetAlpha('A'VAR,1,'my-string',1,9,'FALSE'LOG)

BufSetAlpha('A'VAR,10,'dynamic-string1',1,15,'TRUE'LOG)

BufSetAlpha('A'VAR,14,'dynamic-string2',1,15,'TRUE'LOG)

64-bit

BufSetAlpha('A'VAR,1,'my-string',1,9,'FALSE'LOG)

BufSetAlpha('A'VAR,10,'dynamic-string1',1,15,'TRUE'LOG)

BufSetAlpha('A'VAR,18,'dynamic-string2',1,15,'TRUE'LOG)

See also:

Buffers

SetBufCnvParam

The Online and Rich Client Samples projects (program CS01 and RCS01)

Reference
Attachment 
Attachment