Sharp OZ-707 Operation Manual - Page 87

Forma, Purpose, Remarks, Example

Page 87 highlights

LEN P D FORMA T: LEN "string" Abbreviation: See Also: PURPOSE: Returns the number of characters in a string. REMARKS: The number of characters in the string includes any blanks or non-printable characters such as control codes or carriage returns. EXAMPLE: 10: INPUT "ENTER A WORD";A$ 20: N=LEN A$ 30: PRINT "THE WORD LENGTH IS";N 40: END RUN ENTER A WORD CHERRY THE WORD LENGTH IS 6 [10] Prompts for a word. In this example, the user enters "CHERRY". [20] Finds the length of the word. [30] Prints out the answer. LET p o FORMA T: 1. LET numeric variable = expression = 2. LET string variable string Abbreviation: LE. See Also: PURPOSE: Used to assign a value to a variable. REMARKS: LET assigns the value of the expression to the designated variable. The type of the expression must match that of the variable; i.e. only numeric expressions can be assigned to numeric variables and only string expressions can be assigned to string variables. The LET command may be omitted in all LET statements. 162 163

  • 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
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128

LEN
FORMA
T: LEN "string"
Abbreviation:
See
Also:
PURPOSE:
Returns the number of characters
in
a string.
REMARKS:
The number of characters in the string includes any blanks
or
non-printable characters such as control codes
or
carriage returns.
EXAMPLE:
10: INPUT "ENTER A WORD";A$
20: N=LEN A$
30
: PRINT "THE WORD LENGTH
IS";N
40: END
RUN
ENTER A WORD CHERRY
THE WORD LENGTH
IS
6
[10] Prompts for a word.
In
this example, the user enters "CHERRY".
[20] Finds the length of the word.
[30] Prints out the answer.
162
P
D
LET
FORMA
T:
1. LET numeric variable
=
expression
2. LET string variable
=
string
Abbreviation:
LE.
See
Also:
PURPOSE:
Used to assign a value to a variable.
REMARKS:
LET assigns the value of the expression to the designated variable.
The type
of
the expression must match that of the variable; i.e. only
numeric expressions can be assigned to numeric variables and only
string expressions can
be
assigned to string variables.
The LET command may be omitted
in
all LET statements.
163
p
o