[an error occurred while processing this directive]
![]() | Forms Processor Advanced Commands |
Example:
# parse a known length input file
# the file is 3 lines long
# get the 3 line file into $data
&slurp("data","www/data/datafile.dat");
# find the offset of the first linefeed
$offset = index($data,"\n",0);
# extract from character 0 to the linefeed
$name = substr($data,0,$offset);
# extract everything from the character after the linefeed until the end of the # string into the $data variable again, so that it resets the zero character,
# effectively removing all of the data until there is none left
$data=substr($data,$offset+1,length($data)-$offset);
$offset = index($data,"\n",0);
$street = substr($data,0,$offset);
$data=substr($data,$offset+1,length($data)-$offset);
$offset = index($data,"\n",0);
$city_state_zip = substr($data,0,$offset);
$data=substr($data,$offset+1,length($data)-$offset);
format screen
$name you live at:<br>
$street<br>
($city_state_zip)
.