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

Any characters can be included as data, but if certain ones are used the data item must be enclosed by quote marks (" "). These include punctuation like comma (,), colon (:), blank spaces, and shifted letters, graphics, and cursor control characters.

EXAMPLES of DATA Statement:
   10 DATA 1,10,5,8
   20 DATA JOHN,PAUL,GEORGE,RINGO
   30 DATA "DEAR MARY, HOW ARE YOU, LOVE, BILL"
   40 DATA -1.7E-9, 3.33

DEF FN

TYPE: Statement
FORMAT: DEF FN <name> ( <variable> ) = <expression>

Action: This sets up a user-defined function that can be used later in the program. The function can consist of any mathematical formula. User-defined functions save space in programs where a long formula is used in several places. The formula need only be specified once, in the definition statement, and then it is abbreviated as a function name. It must be executed once, but any subsequent executions are ignored.

The function name is the letters FN followed by any variable name. This can be 1 or 2 characters, the first being a letter and the second a letter or digit.

EXAMPLES of DEF FN Statement:
   10 DEF FN A(X)=X+7
   20 DEF FN AA(X)=Y*Z
   30 DEF FN A9(Q) = INT(RND(1)*Q+1)

The function is called later in the program by using the function name with a variable in parentheses. This function name is used like any other variable, and its value is automatically calculated,


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