DeTextize

DeTextize, turns text passed to it in the second parameter to the type of data passed as a pointer in the first parameter. So, if you're importing from a text file you can load a block, parse a line to a text array then assign everything to fields without having to know their types.

DeTextize (->[Person]LastName;aRay{1}) ` String
DeTextize (->[Person]FirstName;aRay{2}) ` String
DeTextize (->[Person]DateOfBirth;aRay{3}) ` Date
DeTextize (->[Person]NumberOfToes;aRay{4}) ` Real (could have partials)
DeTextize (->[Person]IsA4DDeveloper;aRay{5}) ` Boolean

  ` DeTextize
  ` The Text passed is converted to the type of field or variable passed via pointer

  ` $1 - Pointer to the field or variable that is to receive the value
  ` $2 - The text to be converted

C_POINTER($1)
C_TEXT($2)
C_LONGINT($Type)

$Type:=Type($1->)
Case of 
  : (($Type=Is Alpha Field) | ($Type=Is String Var) | ($Type=Is Text))
    $1->:=$2
    
  : (($Type=Is Real) | ($Type=Is Integer) | ($Type=Is LongInt))
    $1->:=Num($2)
    
  : ($Type=Is Date)
    $1->:=Date($2)
    
  : ($Type=Is Time)
    $1->:=Time($2)
    
  : ($Type=Is Boolean)
    If ($2="True")
      $1->:=True
    Else 
      $1->:=False
    End if 
    
End case