Futurebasic/Language/Reference/str amp

STR&Edit

SyntaxEdit

stringFromHandle$ = STR&(handle&, index%)

RevisedEdit

June 2001 (Release 5)

DescriptionEdit

This function returns a string element from a handle that is in the same format as a resource of type "STR#". The handle& should specify the location of the memory block. index% indicates which string element to get; the first element is numbered 1. If the handle isn't found, or if index% is greater than the number of strings in the resource, the STR& function returns an empty (zero-length) string.

ExampleEdit

This example creates and fills a handle in the form of a STR# resource and displays the results..

DIM sHndl as handle
DIM x as WORD

// create an empty STR# style handle sHndl = FN newhandleclear(2)

// Fill the handle with ASCII strings (1-10)FOR x = 1 TO 10
   DEF APNDSTR("This is number"+STR$(x), sHndl)

NEXT

// Display the handle using STR& FOR x = 1 TO 10
  PRINT str&(sHndl,x)

NEXT

// We made it. We must dispose of it.

DEF DISPOSEH(sHndl)

See AlsoEdit

DEF APNDSTR; DEF REMOVESTR; COMPILE _strResource; STR#