Open main menu

Wikibooks β

Futurebasic/Language/Reference/def apndstr

< Futurebasic‎ | Language‎ | Reference


DEF APNDSTR StatementEdit



✔ Appearance ✔ Standard ✔ Console


DEF APNDSTR(string$, STR#resourceHndl&)


This statement adds the specified string$ to the end of the relocatable block specified by STR#resourceHndl&. STR#resourceHndl& should be a handle to an existing "STR#" resource, or a handle to a block which you intend to save as an STR# resource. To create a new, empty handle for use with DEF APNDSTR, you should create it like this:

myHandle& = FN NEWHANDLE _clear (2)

After you have added strings to the new handle, you can save it as a resource by calling the ADDRESOURCE routine (

To get a handle to an existing "STR#" resource for use with DEF APNDSTR, you can use any of a variety of Resource Manager functions such as GETRESOURCE:


Never use DEF APNDSTR on a purgeable resource, unless you first call FN HNOPURGE (str#handle&) ( to (temporarily) make it unpurgeable. If you think the resource may have been purged before you had a chance to call FN HNOPURGE, then you should also CALL LOADRESOURCE (str#handle&) ( to make sure it's loaded into memory.

If you are using DEF APNDSTR to update an existing "STR#" resource, then use CALL CHANGEDRESOURCE (str#handle&) ( after using DEF APNDSTR, to cause your changes to be written to disk when the resource file is closed or updated.

DEF APNDSTR could cause a system error if heap memory is very low or very fragmented. You can use the MEM(_maxAvail) function periodically to de-fragment memory.

See AlsoEdit

STR#; DEF REMOVESTR; "Resource Manager" chapter ( in Inside Macintosh:, More Macintosh Toolbox: