 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Gefa
Joined: 13 Aug 2008 Posts: 12 Location: Italy
|
Posted: Wed Aug 13, 2008 8:39 pm Post subject: Record |
|
|
Hi!
I have this code:
| Code: |
file = io.open("highscore.txt","r")
record_score = file:read()
file:close()
|
But, when I try to print record_score string with
| Code: |
screen:print(0,0,""..record_score,color)
|
LuaPlayer return an error, "record_score is a nil value"
Whi? _________________ For my PSP project, visit my web site: www.gefa.altervista.org
PaintMIXER v2.6.0 released: http://www.neoflash.com/forum/index.php/topic,5253.0.html |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Thu Aug 14, 2008 1:06 am Post subject: |
|
|
See the file io tutorial here: http://www.evilmana.com/tutorials/lua_tutorial_09.php
It looks like maybe the open() function failed, thus the read() failed also.
Error check that they return successfully.
Also, to read a number you need to pass *n to the read() call. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|