4-183
Detailed explanation of command words
4MELFA-BASIC IV
Def Char (Define Character)
[Function]
Declares a character string variable. It is used when using a variable with a name that begins with a charac-
ter other than "C." It is not necessary to declare variables whose names begin with the character "C" using
the Def Char instruction.
[Format]
[Terminology]
<Character string variable name> Designate a variable name.
[Reference Program]
1 Def Char MESSAGE
' Declare "MESSAGE" as a character string variable.
2 MESSAGE = "WORKSET"
' Substitute "WORKSET" in the MESSAGE variable.
3 CMSG = "ABC"
' Substitute "ABC" for variable CMSG. For variables starting with
C, the definition of "Def Char" is not required.
[Explanation]
(1) The variable name can have up to eight characters. Refer to the
that can be used in program" for the characters that can be used.
(2) When designating multiple variable names, the maximum value (127 characters including command)
can be set on one step.
(3) A variable becomes a global variable that is shared among programs by placing "_" after C in the vari-
able name and writing it in a base program.
Refer to
Page 138, "4.3.24 User-defined external variables"
for details.
Def[]Char[]<Character string variable name>
[, <Character string variable name>...