bufferAddress

bufferAddress(): Integer;

The bufferAddress method of the String primitive type returns an integer containing the value of the pointer to the internal buffer that contains the string. This value may be required when a JADE Binary type value is being mapped to a structured record type for a call to an external function. Call the bufferAddress method to determine the address of the buffer when an external function requires a data structure to contain a pointer to a second structure.

The use of the bufferAddress method for the String primitive type is similar to that for the Binary primitive type. For an example of using the bufferAddress method of the Binary primitive type to initialize the Windows SECURITY_DESCRIPTOR and SECURITY_ATTRIBUTES structures, see bufferAddress, under "Binary Type".

The code fragment in the following example shows the use of the bufferAddress method when copying clipboard data directly into a JADE string.

call copyString(str.bufferAddress, locked);
call globalUnlock(locked);

Do not use this method to pass the address of a string to an external function that will be executed by a presentation client. If an external function is called from an application server method and executed by a different process (the presentation client), the memory address is not valid and will almost certainly result in a jade.exe (thin client) fault in the called function.