9.0

172
[ | Private | Public | Friend ] _
Function name
[type][([param[, ...]])] [As type[()]]
statement
s
End
Function
Group
Declaration
Description
User defined function. The function defines a set of statements to be executed when it is called. The values of the
calling arglist
are assigned to the params. Assigning to name[type] sets the value of the function result.
Function defaults to Public
if Private, Public or Friend are not is specified.
See Also: Declare
, Property, Sub.
Example
Function Power(X,Y)
P = 1
For
I = 1 To Y
P = P*X
Next I
Power = P
End
Function
C:\ABCTemp\vbs\Sub_Definition.htm
Sub
Main
Debug
.Print Power(2,8) ' 256
End
Sub
Get Instruction
Syntax
Get StreamNum, [RecordNum], var
Group
File
Description
Get a variable's value from StreamNum.
Parameter Description
StreamNum Streams 1 through 255 are private to each macro. Streams 256 through 511 are
shared by all macros.
RecordNum For Random mode files this is the record number. The first record is 1. Otherwise, it
is the b
y
te
p
osition. The first b
y
te is 1. If this is omitted then the current
p
osition
(
o
r
record number) is used.
ar This variable value is read from the file. For a fixed length variable (like Long) the
number of bytes required to restore the variable are read. For a Variant variable two
bytes are read which describe its type and then the variable value is read
accordingly. For a usertype variable each field is read in sequence. For an array