GetTapiBlockStr
Unit: hbTapi
 

Retrieves a string out of a TAPI structured block.

Declaration

function GetTapiBlockStr(Block: Pointer; Fields: Pointer; StringFormat: DWORD = 0): String;

Parameter

Block
Pointer to the the TAPI structured block.
Fields
Pointer to the fields.
StringFormat
The string format to convert to using the STRINGFORMAT_ constants. Leave default to get an unconverted ANSII string.
 

Sample

var vsAddress: Tapi.PVarString; Address: String;

GetMem(vsAddress, 1000);
try
  FillChar(vsAddress^, 1000, #0);
  vsAddress^.dwTotalSize := 1000;
  vsAddress^.dwUsedSize := SizeOf(TVarString);

  try
    call.Owner := True;
    hbTapiLine1.Park(call, LINEPARKMODE_NONDIRECTED, '', vsAddress);
    Address := GetTapiBlockStr(vsAddress, @vsAddress^.dwStringSize);
  except
  on E:EhbTapiError do
    // handle error
  end;
finally
  FreeMem(vsAddress);
end;

Return Value

Returns the string at the given position or an empty string if no string is set in block.