Re: Help

new topic     » goto parent     » topic index » view thread      » older message » newer message

>I am very very new to Euphoria and I am trying to make a simple program
that
>opens a file and inputs it line by line and prints it to the screen line by
>line. I can open files and read and write to them but looping until eof I
have
>trouble with. I don't think there is an eof but I tried some things and I
>can't get it to work. So if you can post this simple program for me that
would
>be great. Also say I want someone to type in a filename and they type in
>c:\windows\temp.dat is there a function or do I have to make my own that
>converts that to c:\\windows\\temp.dat??


Im not going to list another program example.
Jeffrey Fielding already did that.
However I am going to explain why you dont need to convert file names.

The euphoria interpreter ex.exe reads in your code and pre-compiles it. At
this stage it parses all your strings and values, and validates your code.
The escape characters are handles in this fase. The existence for escape
characters is to serve the programmer: Otherwise we would need to type
something like: "hello
" to make it jump to the next line. SOmething that is btw illegal, since the
number of spaces, etc. isnt clear and it is thus *bad* style. Instead ex.exe
handles the '\' as the escape character. But the parsing of escape
characters only occurs with strings that are actually typed inside your
program. It would be a hell, if we would have to convert every input. So,
the general rule is, the parsing of escape characters is part of notation
within Euphoria. Like 34873# means a heximal value. The '#' is not part of
the value it represents, it only there to tell Euphoria it is an hex-value,
it is thus part of the notation, just like escape values.

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu