
-----------------------------------
ruscutie
Thu Dec 21, 2006 1:48 am

heyy need help 2 store file
-----------------------------------
kk... guyzz i need help in storing filezz.. the program is underneath
the line which i bolded has an error and it says "INVALID INTEGER INPUT". I was late 4 my class so didn't really get the use of asterisk... if some1 can plzz explain 2 me, i will be able to figure out what is wrong over here... thnx

procedure writing
    open : file, "artists", put
    assert file > 0
    for i : 1 .. 20
        put "Enter artist"
        get singer (i) : *
        put : file, singer (i)
    end for
    for j : 1 .. 20
        put "Enter song"
        get song (j) : *
        put : file, song (j)
    end for
    close : file
end writing

procedure reading
    open : file, "artists", get
    assert file > 0
    for i : 1 .. 20
        get file, singer (i) : *    end for
    for j : 1 .. 20
        get : file, song (j) : *
    end for
    close : file
end reading

-----------------------------------
Clayton
Thu Dec 21, 2006 9:40 am


-----------------------------------
Perhaps you could show us more of your code? From what I can see, nothing should be wrong here. Also, please use [ code][/code] tags when posting code. Another thing, could you show us the test data that you are using? It makes it hard if we have nothing to go on.

-----------------------------------
Albrecd
Thu Dec 21, 2006 3:03 pm


-----------------------------------
I was late 4 my class so didn't really get the use of asterisk... 

The :* allows Turing to 'get' an entire line of input, not just up to the first space character.  For example, when the user inputs "hello, I like cheese" in the following pieces of code:

var word : string
get word
put word

will print "hello,"
and:

var word: string
get word :*
put word

will print "hello, I like cheese"

-----------------------------------
ruscutie
Thu Dec 21, 2006 10:01 pm


-----------------------------------
hey thnx guyzz.. i got & from next time i will post the whole program... 8-)
