Random Access File
Tutorial 8
Type addrrec
StrName
as string * 30
StrAddr
as string *30
StrCity
as string 40
StrState
as string * 2
End type
Dim addressEntry as addrec
·
Relative file
o Open {filename} for random as #1 len=
len(adddressEntry)
o Writing to a relative file
§
Put #filenumber,
{recnumber}, {record}
§
File written in binary
o Reading from a relative file
§
Get #1, {recnumber},
{{record}
·
User Define Procedure
o Sub {routineName} ( {{byval},byref} {}varname} as
{Variable type} ,….)
o Byref is default
§
Byref – variable actual
address passed, contents of variable can be cahnged
§
Byval – copy of
variable made, changes made to copy, original variable left unchanged
·
Trim – function that
removes both leading and trailing spaces and returns the new string leaving
original string unchanged
o Trim({string variable})
·
Forms
o Load {formname} – load form into memory, form not
displayed
o {formname}.show – show form, load into memory if not
previously loaded
o {formname.hide} – removes form from screen, form
still in memory
o unload {formname} – removes form from memory