[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

System Specification for C65Fred BowenMarch 1, 1991

FIND - Find text in a BASIC program.

    FIND :string: [,line_range]
    FIND "string" [,line_range]

This is a direct (edit) mode command. FIND looks for all occurances of string in the program and displays-each line containing string, with string highlighted. Use the C= key to slow the display, or the NO-SCROLL key to pause the display. Press STOP to cancel.

Any character can be used for the string delimiter, but there are side effects. Using a non-quote delimiter will cause the string to be tokenized, and FIND will find only tokenized strings in the program that match. Using a quote character as the delimiter will cause the string to be interpreted as plain PETSCII, and any matches found will therefore be plain PETSCII. Searching for some tokens such as DATA statements may require the use of colons as delimiters due to the special affect these commands have upon the interpreter.

If the line number range is not given (see LIST for description of range parameter), the entire program is searched.

FNxx - User defined function

    FNxx (expression)

The result of this-numeric function is determined by the BASIC program in a DEF FN statement. See the example at DEF FN.

FOR/TO/STEP/NEXT - Program loop definition and control

    FOR index = start TO end [STEP increment]
     |
    NEXT index [,index]

This command group performs a series of instructions a given number of times. The loop index is a floating point (non-integer) variable which will initially be set to the start value and be incremented by the STEP increment when the NEXT statement is encountered. The loop continues until the index exceeds the end value at the NEXT statement.

The start, end, and increment values can be numeric variables or expressions. If the STEP increment is not specified, it is assumed to be one (1). The STEP increment can be any value, positive, negative, or non-integer. If the STEP increment is negative, the loop continues until the index is less than the end value at the NEXT statement.

Note that, regardless of the start, end, or increment values, the loop will alway execute at least once. The index can be modified within the loop, but it is bad practice to do so. it is also bad practice to GOTO a line inside a loop structure, or to similarly jump out of a loop structure (which can cause an out of memory error)


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated May 28, 2002.