[Gambas-user] Class to Read/Write INI files

Frank Berg frankberg at ...390...
Tue Jan 18 07:53:11 CET 2005


hi,

i was find my mistake..

1.)
i was read from an plain textfile, that i was edit with kwrite
before edit with kwrite :
all textlines was clean,
after edit with kwrite all textline was addet an \r
this can be deletet by killing 1 char from right, no problem..
\r = chr(13)

2.)
the textfile i was use, come from the capisuite program
i use as my telefon answer. this program add an new
voice file with an textfile, and my iniFileRead shold read this file.
there are lines like :
[GLOBAL]
call_from = "046122148"  for user with call
call_from = "-"  for user without call

i was read the string with LINE INPUT, and in the execute window i can see 
the
variable with contens. "call_from = \"-\"\r"
after kutting \r and split(s,"=") the value[1] contens are "\"-\""
the \" are now the ascii token for chr(34) = "
after kutting all chr(34) from the value only "-" are shown
and the last 2 " are now from gambas, to show, it is an string variable
the variable self are now clean as - or 046122148

yes, linux is different to windows, but i`m lerning every day :-)

frank

> | LINE INPUT reads the file until finding a newline character '\n' or the 
> end of
> | file. The '\n' character is not returned.
> |
> | On Unix systems, lines are delimited with '\n', not '\r\n' like on 
> Windows
> | (what a stupid idea).
> |
> | > and
> | >
> | > call_from = -
> --8<-----
> Regards,
> |
>
> That is not stupid at all.
>
> It is historical, \n as _newline_ did go to a new line and the
> character position was keep the same.
> The \r as _return_ was the carriage return to be able to bold printing
> by do it twice.
>
> Printer options in the past, for example the FX80 from epson,
> has a option switch to add a _return_ after receiving a _linefeed_
> because it was logical to have it in normal _1 go_ printing.
>
> See a page as an pre printed order form with two columns
> 1 description field and cost and 1 price field per row.
> Go to the second column, print the count and the price, send backspaces
> to go to the start of the 2' column and do linefeed for net price.
>
> This way was more quick on the (very old now) printers in history
> to get nice tabular pre printed order forms. :)
> Now you must print spaces till you are at the 2' column
> what cost more characters than the backspaces.
> Printing to file results also in smaller files.
>
> It is more stupid the way _unix/linux_ does.
> Maybe more user friendly now a days with some mistake behavior.
>
> It is not the fault from printer manufacture, windows/linux/ user does
> print the whole form with the expensive inkjet and ink printers.
> Pre printer sheets are still cheaper than printing your self :).
>
> Back from tennerife with some salt :)
>
> Ron
>
> ps. job done but in april again for 4/6 weeks.
>






More information about the User mailing list