I'm not gifted to speak English, please be indulgent with me.
I'm a new programmer with CPLua. This Add-In is very powerfull but I have a problem.
i've created a "hanged" and now I would like to use a dictionary.
It is composed of list of words as:
File : dico
Fleur Chocolat voiture test
In my main program I want display the first line :
require "io" --- ... --- f = io.file("dico") -- opening file in folder CPLUA/ f:open("r") --read only p = f:read() --read first line print(p)
Now I run the program, it gives me :
Fleur Chocolat -- Why two words appear ???
and if I want to list them :
require "io" --- ... --- f = io.file("dico") -- opening file in folder CPLUA/ f:open("r") --read only p = f:read() --read first line while(p ~= nil and p~= eof) -- i show you, the different things i tested do print(p) p = f:read() end print(p)
The program gives :
Fleur Chocolat voiture test main:73: Couldn't read (null) in file -- I can not avoid the error...
Can you help me please, i'm newbie in CPLua I don't understand.
Thanks a lot ! (and still sorry for my low level of English)