NSBasic for Educators

1. NS BASIC Handbook

Sample page from NS BASIC Handbook

GOSUB Statement

GOSUB lineNumber|label

DESCRIPTION

GOSUB causes execution to branch to the line of code specified by lineNumber. You may use a label in place of the actual line number. A GOSUB must be paired with a RETURN Statement. When a RETURN Statement is found, execution continues from the line after the GOSUB. As with the GOTO Statement, if the lineNumber specified in the GOSUB Statement refers to a REM Statement, NS BASIC will also display that comment at the end of the GOSUB Statement as a line comment when the program is listed. The example shows this automatic commenting behaviour of GOSUB.

 

EXAMPLE

10 REM GOSUB Example
20 PRINT "GOSUB Routines-"
30 GOSUB 70 //Routine #2
40 GOSUB routine3
50 PRINT "Routine #1"
60 END
70 REM Routine #2
80 PRINT "Routine #2"
90 RETURN
110 routine3: REM
120 PRINT "Routine #3"
130 RETURN

OUTPUT
GOSUB Routines-
Routine #2
Routine #3
Routine #1
*

 

related items

REM, GOTO, LIST, RETURN

96 NS BASIC Handbook

The NS BASIC Handbook is a 260 page reference manual for NS BASIC. Each of the commands, statements, functions and widgets is explained. Sample code for each is included. (These examples are also part of the downloadable Examples.pkg file)

2. NS BASIC Reference Card

This handy reference card lists all the commands, statements, functions and widgets, and provides the syntax for their use.

3. BASIC for the Newton, Schettino and O'Hara

This 404 page soft cover book is published by AP Professional, ISBN # 0-12-623955-X. It is a tutorial approach, starts with simple programs and builds up to creating a visual application to keep track of a collection of trading cards. Includes diskette with examples.

5. Student's Tutorial

This tutorial is intended as an aid to sudents in an introductory course in Computer Programming for grades 8 to 12. The text includes crossword puzzles, exercises and lots of examples.

(Available Summer, 1997)

6. Teacher's Guide

This guide is intended to help teachers easily design a good introductory course in Computer Programming for grades 8 to 12. Emphasis is places on getting a good understanding of the required fundamentals, while learning good programming style and modern programming techniques. It also contains the answers to the exercises in the Student's Tutorial. Pages which can be copies onto overheads are included, as well as a diskette with modifiable files.

(Available Summer, 1997)

Previous | Next