Re: confused...
- Posted by Burt Feb 03, 2009
- 950 views
Hi Burt, Welcome to Euphoria, I hope you like it.
Regarding the error, did you, by any chance, tried to print it? Procedures likes put() can't handle a sequence inside a sequence.
Regards,
Hi Guillermo,
Yes, I think that was the problem, when I change the code (as Matt suggested) to:
include get.e sequence input puts(1, "enter some text ") input = get(0) if input[1] != 1 then ? input[2] else puts(1, "not a valid euphoria object!") end if
There was no error message, but the output wasn't what I was expecting. In the manual it says:
Actually, I'm not entirely clear what a "valid" euphoria object is in this context! In the manual it says:
"Input, from file fn, a human-readable string of characters representing a Euphoria object."
Nor am I sure what "human readable" means...
So if I wanted to read in from the keyboard a list of numbers and or strings, would I need to use a loop? and if I wanted to print out what I'd input would I need to test the elements of the sequence to determine which was a string and which was a number. I have a feeling I'm making this more complicated than it actually is.