| View previous topic :: View next topic |
| Author |
Message |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Tue Jun 06, 2006 5:43 am Post subject: Problem with Print() |
|
|
print("string") does not work anymore?! any reasons why?
Im using v0.20 I noticed it does not work in 0.18+ |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Wed Jun 07, 2006 12:01 am Post subject: |
|
|
I don't know where print() should print but have you tried io.write("string\n")? _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Wed Jun 07, 2006 6:41 am Post subject: |
|
|
| neither work |
|
| Back to top |
|
 |
Altair
Joined: 20 May 2006 Posts: 76 Location: The Netherlands
|
Posted: Wed Jun 07, 2006 10:43 am Post subject: |
|
|
| and you are using "screen:print()", right? |
|
| Back to top |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Thu Jun 08, 2006 5:20 am Post subject: |
|
|
| no just the command print() which used to work for debugging purposes. |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Thu Jun 08, 2006 6:19 am Post subject: |
|
|
Perhaps print() command writes somehting on the back buffer of the screen. If so, flip the screen to read the output. If no help, the screen should be turned off somehow in order to view the output on PSP. Of course, you can use Windows version to debug but the version is pretty old. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Thu Jun 08, 2006 6:38 am Post subject: |
|
|
I cant use an old version to debug im useing 5.1 syntax for some file manipulation. And if memory serves me file manipulation has a big problem in the windows client.
Also screen.flip() does not allow me to show an output either. I did a work arround but its a nasty hack I would rather not use. |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Thu Jun 08, 2006 7:39 am Post subject: |
|
|
Sorry, dude. I tried to help.
Perhaps, you could implement Windows version for Lua 5.1 with some additional features as needed in order to debug your thingy. You could get the source at lua.org. I know it is a nasty job to do.
I do mine for Windows version but it is not for PSP. It is all written in Pascal rather than ANSI C.
PS If you do the Windows version, share it with other PSP coders. You'll get a metal with a flying color. :) _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
youresam
Joined: 06 Nov 2005 Posts: 87
|
Posted: Thu Jun 08, 2006 7:41 am Post subject: |
|
|
| print() hasnt worked since the release of .18alpha |
|
| Back to top |
|
 |
daurnimator

Joined: 11 Dec 2005 Posts: 38 Location: melbourne, australia
|
Posted: Thu Jun 08, 2006 10:21 am Post subject: |
|
|
and i think it shouldn't....
get a serial cable to debug... - or just print to the screen... |
|
| Back to top |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Thu Jun 08, 2006 3:59 pm Post subject: |
|
|
| Quote: | | get a serial cable to debug... - or just print to the screen... |
print() is the function i am talking about for such matters. Instead of,
screen:print(0, 0, "text", color.new(0,0,0))
screen.waitVblankStart()
screen.flip()
For each variable output is perposterous just for the sake of a 30 second debug. Print("variable :".. var)
now immagine doing that for multiple variables. Thats just a waste of debugging time a person just wasted on getting data.
Print needs to work, I was posting that it doesnt work so that Shine the creator of the LUA player can fix that.
When i type print("text") it hints to its sucess but fails in display. That obviously needs to be fixed. Since it is not working as inteded.
Now if it was removed then you would get the error
| Quote: | Error: PATH/file.lua:(line): attempt to call global 'print' (a nil value)
Press start to restart |
|
|
| Back to top |
|
 |
romero126
Joined: 24 Dec 2005 Posts: 200
|
Posted: Thu Jun 08, 2006 4:01 pm Post subject: |
|
|
Furthermore here is a workarround for developers to use. (It works just like in dos)
| Code: |
IO_LIB = {
x = 0,
buffer = Image.createEmpty(480, 272),
prebuffer = Image.createEmpty(480, 272)
}
function IO_LIB:PrintF(text)
for i = 1, string.len(text) do
char = string.sub(text, i, i)
if char == "\n" then
self.prebuffer:clear(Color.new(0, 0, 0))
self.prebuffer:blit(0, -10, self.buffer, true)
self.buffer:blit(0, 0, self.prebuffer, 0, 0, 480, 272, true)
self.x = 0
elseif char ~= "\r" then
self.buffer:print(self.x, 264, char, Color.new(255,255,255))
self.x = self.x + 8
end
end
screen:blit(0, 0, self.buffer)
screen.waitVblankStart()
screen.flip()
end
|
|
|
| Back to top |
|
 |
|