QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

[Lua QUESTION] Exit Gracefully?

This is a discussion on [Lua QUESTION] Exit Gracefully? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Is there a built in function in Lua to immediately quit the program (besides the home function) Right now I ...

Reply
 
LinkBack Thread Tools
Old 09-25-2005, 08:48 AM   #1
 
Jenay's Avatar
 
Join Date: Jun 2005
Posts: 52
Trader Feedback: 0
Default [Lua QUESTION] Exit Gracefully?

Is there a built in function in Lua to immediately quit the program (besides the home function)

Right now I just call a undefined function to make it crash.

Thanks.
Jenay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 08:49 AM   #2
 
PurePwnage's Avatar
 
Join Date: Sep 2005
Location: Miami, Florida.
Posts: 217
Trader Feedback: 0
Default

would it be exit or something? im still learning lua also.. but i just made a program.
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url]
-=-=-=-=-=-=-
"15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB
PurePwnage is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 08:50 AM   #3
NDS Mod
 
MagicianFB's Avatar
 
Join Date: Jul 2005
Location: w00+land
Posts: 645
Trader Feedback: 0
Default

Yes, that would be nice because when you press home it comes up with a wierd errorscreen before going back.
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me
[URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL]
MagicianFB is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 01:40 PM   #4
 
Join Date: Jun 2005
Posts: 327
Trader Feedback: 0
Default

doesnt this do the job ? I dont have my PSP hooked up right now, so try this:

Code:
while true do

all of your code that needs to be in here


if pad:start() then
		break
	end

rest of your code here
I tried posting an example of code after this for you, but I keep getting this error:
Quote:
You have included too many images in your signature or in your previous post. Please go back and correct the problem and then continue again.

Images include use of smilies, the vB code [img] tag and HTML <img> tags. The use of these is all subject to them being enabled by the administrator.
I used the code tags for it, but I seem to be having issues post the code. Oh well.

Last edited by F34R; 09-25-2005 at 01:45 PM..
F34R is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 01:48 PM   #5
 
PurePwnage's Avatar
 
Join Date: Sep 2005
Location: Miami, Florida.
Posts: 217
Trader Feedback: 0
Default

its just plain break to end the kill the code I guess.
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url]
-=-=-=-=-=-=-
"15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB
PurePwnage is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 03:24 PM   #6
 
Jenay's Avatar
 
Join Date: Jun 2005
Posts: 52
Trader Feedback: 0
Default

error: no loop to break near 'end'
Jenay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 03:27 PM   #7
 
PurePwnage's Avatar
 
Join Date: Sep 2005
Location: Miami, Florida.
Posts: 217
Trader Feedback: 0
Default

Then there's no way to exit it gracefully.. only through home menu.
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url]
-=-=-=-=-=-=-
"15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB
PurePwnage is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 03:45 PM   #8
 
Join Date: Aug 2005
Posts: 28
Trader Feedback: 0
Default

To exit a simple program is just to break it. A simple example:

Code:
white = Color.new(255, 255, 255)

while true do
     screen:clear()
     screen:print(0, 0, "Hello World", white)
     screen:print(0, 10, "Press Start to Exit.", white)
     screen.flip()

     pad = Controls.read()

     if pad:start() then
          break
     end
end
jazazel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-25-2005, 04:25 PM   #9
 
PurePwnage's Avatar
 
Join Date: Sep 2005
Location: Miami, Florida.
Posts: 217
Trader Feedback: 0
Default

Quote:
Originally Posted by jazazel
To exit a simple program is just to break it. A simple example:

Code:
white = Color.new(255, 255, 255)

while true do
     screen:clear()
     screen:print(0, 0, "Hello World", white)
     screen:print(0, 10, "Press Start to Exit.", white)
     screen.flip()

     pad = Controls.read()

     if pad:start() then
          break
     end
end
OH! So I was partly right! It goes back to the XMB correct?
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url]
-=-=-=-=-=-=-
"15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB
PurePwnage is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-26-2005, 07:32 AM   #10
 
Jenay's Avatar
 
Join Date: Jun 2005
Posts: 52
Trader Feedback: 0
Default

it works if you are NOT in a function:

this pops an error:
Code:
white = Color.new(255, 255, 255)
function PlayTheGame()
     pad = Controls.read()
     if pad:start() then
          break
     end
end
while true do
     screen:clear()
     screen:print(0, 0, "Hello World", white)
     screen:print(0, 10, "Press Start to Exit.", white)
     screen.flip()
     PlayTheGame()
end
Jenay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-26-2005, 08:48 AM   #11
 
Join Date: Aug 2005
Posts: 28
Trader Feedback: 0
Default

Post the Error with it.
jazazel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-26-2005, 09:11 AM   #12
I think I ripped my pants
 
whitehawk's Avatar
 
Join Date: Jul 2005
Real First Name: Matt
Location: Toronto
Just Played: Trials HD
Posts: 6,485
Trader Feedback: 0
Default

If you put "if pad:start() then
break
end"

That will just exit the lua script, then you will get a screen saying "press start to restart.
whitehawk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-26-2005, 09:51 AM   #13
 
Jenay's Avatar
 
Join Date: Jun 2005
Posts: 52
Trader Feedback: 0
Default

Quote:
Originally Posted by jazazel
Post the Error with it.
same error as before:
error: no loop to break near 'end'
Jenay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
exit , gracefully , lua , question

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 04:07 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us