GetStringValue method

Delphi example

C++Builder example

 

Builder Syntax

int __fastcall GetStringValue(Cardinal uIndex, Cardinal uCount);

Delphi Syntax

function GetStringValue(uIndex, uCount: Cardinal): Integer;

Overview

Refer to Working with Data Sets.

Remarks

Updates the StringValues property with the string value(s) associated with the item specified in the CurrentElement property. This method also updates the StringValueCount property to uCount, where uCount is the number of strings to get.

If you call this method with uCount greater than the number of strings in the Value Field of the specified item, this method will return an error. For example, if there are only three strings in the Value Field and you call this method with uCount set to four, an error will be returned.

If you have more than one value stored in the Value Field of the specified Data Element, you can retrieve one or more of those elements. For example, if the Value Field of the specified Data Element contains three string values, and you are only interested in retrieving the last two string values, set uIndex to 1 and uCount to 2. This tells the method to retrieve the string values starting at position 1 (the index is zero based) and retrieve two values. Therefore you would retrieve the values in positions 1 and 2 in the Value Field.

This method can be called only if the Value Representation of the Data Element is VR_AE, VR_CS, VR_LO, VR_LT, VR_SH, VR_ST, VR_UI, VR_UT, VR_PN. For more information about Value Representations, refer to Default Value Representation Table.

When more than one string is retrieved, all strings, separated by the 0 delimiter, are in the character string returned by this function. For example, the illustration below shows the returned character string, containing three strings separated by the 0 delimiter.

image\String.gif

See Also

Elements:

GetAgeValue method, GetBinaryValue method, GetCharValue method, GetLongValue method, GetFloatValue method, GetDoubleValue method, GetDateValue method, GetShortValue method, GetDateTimeValue method, GetTimeValue method