QuickBASIC AllocTempDesc Gets Descriptor of Last String Used (45173)






This article was previously published under Q45173

SUMMARY

This article describes the AllocTempDesc library support routine, which can be used in interlanguage calling in QuickBASIC 1.00 for the Macintosh.

AllocTempDesc is a routine that allocates a temporary BASIC string descriptor. The descriptor obtained is the temporary string descriptor for the last string that was assigned a value. For example, if a variable A$ is the last string assigned a value before AllocTempDesc is called, then this is the variable that the temporary string descriptor is allocated for. Temporary descriptors are used by other routines in the support library such as AssignString. AllocTempDesc is documented on Page 458 in the "Microsoft QuickBASIC for Apple Macintosh: Language Reference" manual.

MORE INFORMATION

Library support routines are needed to do interlanguage calling from QuickBASIC to Assembly, PASCAL, or C language routines. From assembly language routines, library support routines are accessed by using an offset from a jump table pointed to by register A5. Pure-code-resource routines, such as those created in Lightspeed C, must link with the library support routine files provided on the distribution disks in order to use these support routines. More information on library support routines can be found on Pages 457-467 in the "Microsoft QuickBASIC for Apple Macintosh: Language Reference" manual. The assembly language code for these routines is provided on the QuickBASIC 1.00 distribution Examples disk in the User Libraries folder.

Code Example

A sample program, AddString.C, uses AllocTempDesc to add two strings into a third string. This program can be found on the QuickBASIC 1.00 Examples disk under the folder path "User Libraries:MBPC Rsrcs:LSC PCR:", where you will find the files "AddString.C" and "AddStrings Proj". You can load this program's source file into the QuickBASIC 1.00 editor, but you must have Lightspeed C to compile it into a Pure Code resource.

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB45173