Re: sequences read from file

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

You should use get() instead of gets().

-- example

sequence result
result = get(fn_in)
if result[1] = GET_SUCCESS then
    if sequence(result[2]) then
        ... etc.


-  Colin Taylor

----- Original Message -----
From: felix geiger <felix.geiger at GMX.CH>
To: <EUforum at topica.com>
Sent: Thursday, February 01, 2001 9:24 AM
Subject: sequences read from file


hi everybody

i have a file and in that file (referred to as fn_in) there is this:

{{00,10,01},{"ç",3,"text"},{"#",5,"text"}
{"ç",1500,"text3"},{"#",1600,"text4"}
{"ç",1500,"text5"},{"#",1600,"text6"}}
{{00,10,02},{"ç",3,"text"},{"#",5,"text"}
{"ç",1500,"text3"},{"#",1600,"text4"}
{"ç",1500,"text5"},{"#",1600,"text6"}}


now i use

    line = gets(fn_in)
    if sequence(line) then
        puts(fn_out, line[1][1])
    end if

i thought this would write this into the output file (referred to as
fn_out)

00

because i thought that line[1] is {00,10,01} and then line[1][1]
should be 00.

but it gives me an error (attempt of subscripting an atom).

what do i do wrong?

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

Search



Quick Links

User menu

Not signed in.

Misc Menu