rset - move data into random file buffer


rset StrVar = StrExpr


Rset places data into a random file buffer in preparation for being moved into the random file with a put statement.  StrVar is the name of a variable that was defined in a field statement.  StrExpr is a string expression containing the data to be placed into the field associated with StrVar.  If StrExpr is shorter than the field associated with StrVar, the data is inserted into the field, right-justified and padded on the left with spaces.  If StrExpr is longer than the field, the data string is truncated on the right and inserted into the field.  Numeric values must be converted to binary strings with mki$, mks$ or mkd$ before using rset. 


	 10 open "addrph" as #1 len = 150
	 20 field 1, 35 as n$, 80 as a$, 15 as ph$
	 30 lset n$ = "Basmark Corporation"
	 40 lset a$ = "1717 East Ninth Street, Cleveland, Ohio"
	 50 rset ph$ = "800-555-1212"
	 60 put 1
	 70 close 1
	 80 open "addrph" as #1 len = 150
	 90 field 1, 35 as n$, 80 as a$, 15 as ph$
	100 get 1
	110 print n$
	120 print a$
	130 print "phone number: "; ph$
	140 close 1
produces the output
	Basmark Corporation
	1717 East Ninth Street, Cleveland, Ohio
	phone number:    800-555-1212
Lines 30 through 50 put information into the buffer, and the put statement in line 60 writes the buffer to the file. 


field, get, lset, mki$, mks$, mkd$, open, put

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber