Original Author Paul Laughton, 2011
Page 97
De Re BASIC!
PRINT "New", "Message"
% Prints: New, Message
PRINT "New";" Message"
% Prints: New Message
PRINT "New" + " Message"
% Prints: New Message
? 100-1; " Luftballons"
% Prints: 99.0 Luftballons
? FORMAT$("##", 99); " Luftballons" % Prints: 99 Luftballons
PRINT "A";"B";"C";
% Prints: nothing
PRINT "D";"E";"F"
% Prints: ABCDEF
Print with User-Defined Functions
Note: Some commands, such as Print, can operate on either strings or numbers. Sometimes it has to try
both ways before it knows what to do. First it will try to evaluate an expression as a number. If that fails,
it will try to evaluate the same expression as a string.
If this happens, and the expression includes a function, the function will be called twice. If the function
has side-effects, such as printing to the console, writing to a file, or changing a global parameter, the
side-effect action will also happen twice.
Eventually this problem should be fixed in BASIC!, but until then you should be careful not to call a
function, especially a user-defined function, as part of a Print command. Instead, assign the return value
of the function to a variable, and then Print the variable. An assignment statement always knows what
type of expression to evaluate, so it never evaluates twice.
! Do this:
y = MyFunction(x)
Print y
! NOT this:
Print MyFunction(x)
Cls
Clears the Output Console screen.
Console.front
Brings the Output Console to the front where the user can see it.
If BASIC! is running in the background with no screen visible, this command brings it to the foreground.
If you have a different application running in the foreground, it will be pushed to the background.
If BASIC! is running in the foreground, but the Graphics or HTML screen is in the foreground, this
command brings the Console to the foreground. BASIC! remains in Graphics or HTML mode.
Console.line.count <count_nvar>
Sets the return variable <count_nvar> to the number of lines written to the Console. This command
waits for any pending Console writes to complete before reporting the count.
Console.line.text <line_nexp>, <text_svar>
The text of the specified line number of the Console is copied to the <text_svar>.