Old 01-04-2010, 03:43 PM
bzdbbb's Avatar
bzdbbb bzdbbb is offline
X-Fi2 Development Moderator
Join Date: Dec 2009
Location: Gloucestershire, UK
Posts: 94

I read those articles and wrote the following code. I don't understand why it doesn't work..

-- get the previous highscores
    file ="highscore.txt", "r");
    highscore = file:read("*n");
and then later

The code works fine without this addition. What's wrong with it?

Thank you in advance
Reply With Quote

Advertisement [Remove Advertisement]

Old 01-06-2010, 05:11 AM
tr00st tr00st is offline
Junior Member
Join Date: Jan 2010
Location: Suffolk, UK
Posts: 4


Not sure exactly what the problem is... Does this give an "Error Occured" error, rather than just not working as expected? If so, you might want to try catching the error using pcall. You might use something like:

function wrappedCode(argument)
  -- Your code here, instead of the error line
  error "This would not be here if you had some code!"
success, message = pcall(wrappedCode, "String as argument")
After running, that would set the variable success to true when the code executed fine, or false if there's an error, as well as setting "message" to any error message that was given.

Hope that helps!
Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 11:50 AM.