The String function turns numbers into text. Textize, turns anything passed to it to text. Well, except BLOBs & Pictures. It'll even convert a 1D array to text (Not 2D arrays though, sorry.)

Basically, it's just a Case Of statement that checks for the type of the field or variable passed and takes appropriate actions. For arrays passed, it returns a single string of the text version of each element of the arrays separated by the specified delimiter.

Here's some examples of how and what:

If vRateOfDecay is 5.
$Text:=Textize (->vRateOfDecay)
$Text = "5"

If aLaser is an array of reals.
$Text:=Textize (->aLaser;False;",")
$Text = "1,7.23,42.24,..."

Okay, so what, String does that, right? Where this becomes useful is when you don't know what type of data the pointer will be pointing to. For instance, if you want to populate a grid of variables on a form from different fields or maybe you want a choice list which only takes string or text arrays or you want your own generic export routine.

  ` Textize
  ` Returns the text equivalent of what was passed

  ` $1 - Pointer to the variable to be Textized
  ` $2 - True if to be returned with "quotes" of the proper type (ie ?10/28/57?)
  ` $3 - Delimiter if passing an array

` <>QU is defined in the database as Char(34)


If (Count parameters>=2)
End if 

Case of 
  : (($Type=Is Alpha Field ) | ($Type=Is String Var ) | ($Type=Is Text ))  ` Just return the string
  : (($Type=Is Real ) | ($Type=Is Integer ) | ($Type=Is LongInt ))  ` Convert to string
  : ($Type=Is Time )  ` Convert to string
  : ($Type=Is Date )  ` Convert to string
  : ($Type=Is Boolean )
    If ($ObjectPtr->)
    End if 
  : (($Type=Boolean array ) | ($Type=Date array ) | ($Type=Integer array ) | ($Type=LongInt array ) | ($Type=Real array ) | ($Type=String array ) | ($Type=Text array ))
    For ($Ndx;1;Size of array($ObjectPtr->))
      RESOLVE POINTER($ObjectPtr;$ArrayName;$TableNum;$FieldNum)
      $ElementPtr:=Get pointer($ArrayName+"{"+String($Ndx)+"}")
      $Text:=$Text+$Delimiter+Str_Textize ($ElementPtr;$AddQuotes)
    End for 
    If (Length($Text)>0)
    End if 
    $AddQuotes:=False  ` We don't want quotes around the whole list even if the elements got them
    $Text:=""  ` For the ones that can't be converted (ie, 2D arrays, BLOBs, etc.)
End case 

If ($AddQuotes)
End if