Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- LanMan Library Reference Guide - <b>ll_str2mem()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 LL_STR2MEM()
 Copy a string to a static memory location
------------------------------------------------------------------------------

 Syntax

      LL_Str2Mem( <cString> ) -> nSelector

 Arguments

     <cString> is the string to copy to memory

 Returns

     <nSelector>, which is a protected mode selector which can be used
     to access the memory location where the string is stored. If the
     copy fails, zero (which is an invalid selector) will be returned.
     In real mode, <nSelector> contains (nSegment*65536)+nOffset of the
     allocated memory.

 Description

     LL_Str2Mem() can be used to copy a character string from a Clipper
     variable to a memory location. The string can then be accessed by
     specifying the memory address rather than the variable name. This is
     useful for passing the string to certain DOS functions.

     The largest string that can be handled in Clipper is 64504 bytes,
     and that also limits the size of the string that can be passed to
     LL_Str2Mem().

     NOTE: The memory occupied by (the copy of) the string must be released
     with LL_FreeMem() when it is no longer needed, otherwise the appli-
     cation will sooner or later crash when it runs out of memory.

     LL_Str2Mem() requires the CPMI library.

 Examples

     local cString := "Hello world!'
     local nSelector
     nSelector := LL_Str2Mem(cString)
     if nSelector > 0
        ? 'The string was copied to memory'
        // Use the memory block for some purpose ...
        // ... and then release it
        LL_FreeMem(nSelector)
     else
        ? 'Could not copy the string to memory'
     endif

 Source: STR2MEM.ASM

 Author: Klas Engwall <klas.engwall@engwall.com>

See Also: LL_FreeMem() LL_Mem2Str()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson