Help
Read/Write
instructions:
- readchr()
Reads one character at a time from "Text input". The first time
it is called in an execution, it returns the first character and then keeps
track of which was the last read character, so that it returns the next one
sequentially in successive calls.
- readstr()
Reads the text in "Text input" until the end of line, into a single
string which it returns. Successive readstr()
will read the following lines in order.
- readval()
Reads the text in "Input text" expecting it to be a number. It returns
the numeric value. Successive readval()
will read the following lines in order.
- write(text)
It writes the text passed
as parameter into the "Result ouput", concatenating it to the existing
text.
Programming
steps:
- Write
the program into the "Program" text area.
- The
main function of your program must be called main()
- Once
your program is ready, click on "Validate". You will get an execution/interaction
area on the right frame.
- If
the program needs any input, write it in the "Text input" area.
- To
execute your program click on "Run".
- Any
results from your program should output in the "Result output" area.
- If
your program does not do what you expected, you may check for JavaScript errors
in the floating "Communicator Console" window. Note:
This error checking environment works only with Netscape Communicator.