up previous next
3.7.2 Standard IO
Standard IO is what takes places normally when one interacts with CoCoA via the CoCoA window. CoCoA accepts and interprets strings typed in by the user and prints out expressions. If E is a CoCoA object, then the command
causes the value of E to be printed to the CoCoA window. One may also use the functions Print and PrintLn for more control over the format of the output.

The official devices that are being used here are DEV.STDIN and DEV.OUT. So for instance, the commands Get and Print On can be used with the standard devices although they are really meant to be used with the other devices. Print E On DEV.OUT is synonymous with Print E. Also, one may use Get(DEV.STDIN,10), for example, to get the next 10 characters typed in the CoCoA window. Thus, clever use of Get will allow your user-defined functions to prompt the user for input, but normal practice is to pass variables to a function as arguments to that function.