bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
StringAddress Routine Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
The StringAddress routine is used in mixed-language programming. A
non-BASIC routine uses StringAddress to find the far address of a BASIC
variable-length string.
 
far-address = StringAddress(string-descriptor%);
    ■ The preceding syntax is for the C language.
    ■ For C, MASM, Pascal, and FORTRAN examples, see Chapter 13,
      "Mixed-Language Programming with Far Strings" in the Programmer's Guide.
 
Usage Notes
    ■ Calls to the StringAddress routine are always made from a non-BASIC
      routine to find the address of a string that was transferred to
      BASIC from the non-BASIC routine.
 
      ║ Note:  If you are not doing mixed-language programming, there is
      ║        usually no reason to use StringAddress. Within BASIC, you
      ║        can use SSEGADD to find the far address of a variable-length
      ║        string.
 
    ■ As an example, assume that you have passed a string from a MASM
      routine to BASIC's string space using StringAssign. The descriptor for
      the string exists at offset descriptor. MASM can find the far address
      of the string data by using the following code:
 
        .model
        extrn        stringaddress: far
 
        .code
        lea          ax, descriptor        ; offset of descriptor
        push         ax
        call         stringaddress
 
      The far address is returned in DX:AX. DX holds the segment and AX
      holds the offset.
    ■ For detailed instructions on mixed-language programming with strings,
      see Chapter 12, "Mixed-Language Programming" and Chapter 13,
      "Programming with Near Strings" in the Programmer's Guide.