FutureBasic Logo

<<    Index    >> FutureBasic 5

str&   function



Syntax:
stringFromHandle$ = str&(handle&, index%)

Description:
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.

Example:
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.
DisposeH(sHndl)


See Also:
compile _strResource; str#