Vtech PreComputer Power Pad Plus User Manual - Page 61

Gosub 120, Other Program Lines, Print Welcome To The, Print Precomputer Power Pad Plus, Return,

Page 61 highlights

Example: 30 GOSUB 120 . . other program lines . . 120 PRINT "WELCOME TO THE" 130 PRINT "PRECOMPUTER POWER PAD PLUS" 140 RETURN GOTO Line # GOTO line number The GOTO statement is used to change the normal flow of the program (which is from the lowest statement number to the highest). A GOTO command transfers control to the specified line. Examples: 10 GOTO 130 200 GOTO 65 IF...THEN...ELSE In general terms, the IF...THEN... statement is used for CONDITIONAL BRANCHING. It uses the general form "IF (condition) THEN (action clause)". A condition is made up of an expression, a relation and another expression. Any BASIC expression, either numeric or string, may be used, but both expressions must be the same type. 57

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88

57
Example:
30
GOSUB 120
.
.
other program lines
.
.
120
PRINT “WELCOME TO THE”
130
PRINT “PRECOMPUTER POWER PAD PLUS”
140
RETURN
GOTO
Line #
GOTO
line number
The
GOTO
statement is used to change the normal flow of the program (which is from
the lowest statement number to the highest).
A
GOTO
command transfers control to the
specified line.
Examples:
10
GOTO 130
200
GOTO 65
IF...THEN...ELSE
In general terms, the
IF
...
THEN
...
statement is used for
CONDITIONAL BRANCHING
.
It
uses the general form “
IF
(condition)
THEN
(action clause)”.
A condition is made up of
an expression, a relation and another expression.
Any
BASIC
expression, either numeric or string, may be used, but both expressions must
be the same type.