lotus



previous page: B01) How do you compare text strings in BETA?
  
page up: BETA Programming Language FAQ
  
next page: B03) Why does getInt followed by getLine not necessarily work as expected?

B02) How do you read and write text in BETA?




Description

This article is from the FAQ, by with numerous contributions by others.

B02) How do you read and write text in BETA?

Texts are written onto standard output by:

'hello'->screen.puttext;

which writes the string 'hello' on the screen at current cursor position.

'hello'->screen.putline;

also writes a carriage-return.

Integers are written by:

7->screen.putInt;

If you want to write onto other text variables (such as t: @text), you can
do it by:

   'hello'->t.puttext;
   'hello'->t.putline;
   7->t.putInt;

Reading texts is equally easy:

keyboard.getline->s[];

reads a line of text from the keyboard, and assigns a reference to the read
text to the text reference s (assumed to be declared as s: ^text).

Reading from other texts (e.g. t) is done by:

t.getline->s[];


 

Continue to:















TOP
previous page: B01) How do you compare text strings in BETA?
  
page up: BETA Programming Language FAQ
  
next page: B03) Why does getInt followed by getLine not necessarily work as expected?