Re: Pair of Problems partly solved
- Posted by Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> Sep 20, 1998
- 553 views
>I changed it to "get" and it works fine but now it gives me the message >"true/false condition must be an ATOM. at the line below. I cant tell by the code you gave, however I suspect you want to know this: Get returns a sequence of 2 element. The first element is the succes/error value, the second the result value. in = get (0) -- Now type: "Hello, dear!" if in[1] = GET_FAIL then puts (1, "Whatever you typed, it didnt make sence for me!\n") elsif in[1] = GET_EOF then puts (1, "You typed too little, why not finish it before pressing enter!\n") elsif in[1] = GET_SUCCES then puts (1, "Now, that *does* make sense!\n") print (1, in[2]) end if -- in[2] only contains the value whenever in[1] = GET_SUCCES which is whenever we could make a number out of the input. Remember that Euphoric input using print () and get () is pretty flexible. If the user enters: { 1, 2, 3} it will return {1, 2, 3} So be aware, the user is also allowed to define whole sequences, or use heximal values.. There is a very nice demo program that comes with euphoria that shows exactly how to use get () and print (). Ralf