qb45advr.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
SUB...END SUB Statement Programming Examples
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
SUB...END SUB Statement Programming Examples
SUB_EX.BAS is a program file in the subdirectory ADVR_EX that illustrates
the SUB...END SUB statement. To look at the program in the View window and,
optionally, to run it, load the program using the File menu's Open Program
command.
The main program calls a subprogram which searches for a given string in
each line of input from a file. When the subprogram finds the string in a
line, it prints the line, along with the number of the line. Notice that
the value of a line number counter is saved between calls because the
STATIC keyword is used on the SUB statement.
Below is sample output from the program:
Pattern to search for? SUB
Line # 9 : SUB Linesearch(Test$,P$) STATIC
Line # 13 : END SUB