forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Record

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Gefa



Joined: 13 Aug 2008
Posts: 12
Location: Italy

PostPosted: Wed Aug 13, 2008 8:39 pm    Post subject: Record Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Thu Aug 14, 2008 1:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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