Applesoft: Internals--String Utilities (1 of 2) Applesoft strings have two parts: the descriptor and the ASCII string. Your string descriptor contains the length of the string along with the address of the strings first character. Refer to page 137 of the Applesoft Reference Manual for additional information on the string components. During most Applesoft routines the descriptor is left in memory, while a two byte pointer to the descriptor is kept in the FAC. The pointer is the address of the descriptor; therefore, the actual string could be anywhere in memory. The statement 10 A$ = "HI" leaves a descriptor pointing to the program text. STRINI E3D5 STRINI obtains space for creating a string whose descriptor is pointed to by FACMO/FACLO; it also creates a descriptor for it in DSCTMP. On entry A = length of the string, while FACMO/FACLO point to the string descriptor. STRINI uses GETSPA to force garbage collection when there isn't sufficient room; GETSPA exits with an "OUT OF MEMORY ERROR" when garbage collection free up enough room. GETSPA moves FRESPC and FRETOP down, making room to store the string. STRINI returns with the descriptor of the new string in DSCTMP and the original pointer in DSCPNT. STRSPA E3DD STRSPA obtains space for the creation of a string A bytes long, then creates a descriptor for it in DSCTMP. STRSPA uses GETSPA to force garbage collection when there isn't enough room. If garbage collection is unable to make sufficient room, GETSPA exits with an "OUT OF MEMORY" error. GETSPA moves FRESPC and FRETOP down enough to store the string, then returns A unchanged with the new descriptor in DCSTMP. GETSPT DA7B GETSPT moves the descriptor pointed to by FACMO/FACLO into the memory pointed to by FORPNT. GETSPT also moves the string's text up to FRETOP if it isn't in the program's text. GETSPT frees up the string if it was a temporary string. GETSPT uses GETSPA to initiate garbage collection, or alternatively "OUT OF MEMORY" error when the garbage collection dosen't free up sufficient room. MOVINS E5D4 Moves the string whose descriptor is pointed to by STRNG1 to memory pointed to by FRESPA. MOVSTR E5E2 MOVSTR moves the string pointed to by Y,X with a length of A to memory pointed to by FRESPA. Apple Tech Notes Keywords: ================================================================== This information is from the Apple Technical Information Library. ArticleID: TECHINFO-0000077 19960724 15:55:27.00 .