ByteString

 (Available in 00 TS Tools(Base) - TS_Tools_String)

Purpose

Set new value as string

Syntax

oString:ByteString:="Test"

Arguments

cByteString
STRING

Description

Set new value as string, if the value is a NULL_STRING then the access 'WordString' will return a NULL_PTR

Example

oString:ByteString:="Test"
SomeAPICallNeedingBSTR( oString:WordString )

Source

ASSIGN ByteString( cByteString AS STRING ) AS STRING PASCAL CLASS TS_String
   TSTrace Enter
   IF SELF:IsValidObject
      DO CASE
      CASE !LOGIC( _CAST, SLen( cByteString ) )
         IF SELF:_WordString<>NULL_PTR
            IF SELF:_MemFree
               SysFreeString( SELF:_WordString )
            END
            SELF:_WordString:=NULL_PTR
         END
         SELF:_ByteString:=NULL_STRING
      CASE !( SELF:_ByteString==cByteString )
         IF SELF:_WordString<>NULL_PTR
            IF SELF:_MemFree
               SysFreeString( SELF:_WordString )
            END
            SELF:_WordString:=NULL_PTR
         END
         SELF:_ByteString:=cByteString
      END
   ELSE
      TSTrace Warning "!SELF:IsValidObject"
   END
   TSTrace Leave
RETURN SELF:_ByteString