Reading BMP file from Simulator folder

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading BMP file from Simulator folder

rmodesi
I am using the Palm One simulator for Zire 72s and Plua 2.09. I am
attempting to read a bmp file from the zire/Card1/Data folder using
the following code

(64) bmp,bmp_width,bmp_height = buffer.read("Card1:/Data/RectBm.bmp")
(65) width,height = screen.mode()
(66) buffer.put(bmp,(width-bmp_width)/2,(height-bmp_height)/2)
(67) buffer.free(bmp)

Plua returns the following information screen

C:\Plua\CBeam.lua:64:
attempt to perform
arithmetic on global
'bmp_width'(a string value)

I have inserted the following line after line (64)
 print("bmp_width = ",bmp_width)
and Plua responds with
 bmp_width=  No such file or directory.

These are the only messages and no bitmap is displayed. The code was
taken from the Plua 2.0 documentation by Mr. de Andrade.

Many thanks in advance for the help.

Ron Modesitt


Reply | Threaded
Open this post in threaded view
|

Re: Reading BMP file from Simulator folder

Stefan Vorkoetter
Looks to me like buffer.read is returning the error message "No such file or directory" as its second result, which is getting assigned to bmp_width. That explains the print output, and it explains why it's complaining about doing arithmetic on a string.

ron.modesitt wrote:

> I am using the Palm One simulator for Zire 72s and Plua 2.09. I am
> attempting to read a bmp file from the zire/Card1/Data folder using
> the following code
>
> (64) bmp,bmp_width,bmp_height = buffer.read("Card1:/Data/RectBm.bmp")
> (65) width,height = screen.mode()
> (66) buffer.put(bmp,(width-bmp_width)/2,(height-bmp_height)/2)
> (67) buffer.free(bmp)
>
> Plua returns the following information screen
>
> C:\Plua\CBeam.lua:64:
> attempt to perform
> arithmetic on global
> 'bmp_width'(a string value)
>
> I have inserted the following line after line (64)
>  print("bmp_width = ",bmp_width)
> and Plua responds with
>  bmp_width=  No such file or directory.
>
> These are the only messages and no bitmap is displayed. The code was
> taken from the Plua 2.0 documentation by Mr. de Andrade.
>
> Many thanks in advance for the help.
>
> Ron Modesitt
>
>
>
>
>  
> Yahoo! Groups Links
>
>
>
>
>


--
Stefan Vorkoetter
Capable Computing, Inc.
http://www.motocalc.com

Small Things Aviation
Electric R/C, Homebuilt, and General Aviation
http://www.stefanv.com 
Reply | Threaded
Open this post in threaded view
|

Re: Reading BMP file from Simulator folder

rmodesi
Stephan,
Thanks for the reply. I agree with you that buffer.read is the
problem. I suspect that the configuration of the Palm Simulator is
the problem. I am not very familiar with the Palm Simulator but it
seems to work with other applications. I did check Card Info and
there is definitely no card registered. I did some checking against
the Palm Emulator from Access and there is a HostFS.PRC file used in
that application but I could find nothing of the sort for the Palm
Simulator (Palm Inc). Any ideas?

Thanks
Ron
--- In [hidden email], Stefan Vorkoetter <stefan@...> wrote:
>
> Looks to me like buffer.read is returning the error message "No
such file or directory" as its second result, which is getting
assigned to bmp_width. That explains the print output, and it
explains why it's complaining about doing arithmetic on a string.
>
> ron.modesitt wrote:
> > I am using the Palm One simulator for Zire 72s and Plua 2.09. I
am
> > attempting to read a bmp file from the zire/Card1/Data folder
using
> > the following code
> >
> > (64) bmp,bmp_width,bmp_height = buffer.read
("Card1:/Data/RectBm.bmp")

> > (65) width,height = screen.mode()
> > (66) buffer.put(bmp,(width-bmp_width)/2,(height-bmp_height)/2)
> > (67) buffer.free(bmp)
> >
> > Plua returns the following information screen
> >
> > C:\Plua\CBeam.lua:64:
> > attempt to perform
> > arithmetic on global
> > 'bmp_width'(a string value)
> >
> > I have inserted the following line after line (64)
> >  print("bmp_width = ",bmp_width)
> > and Plua responds with
> >  bmp_width=  No such file or directory.
> >
> > These are the only messages and no bitmap is displayed. The code
was

> > taken from the Plua 2.0 documentation by Mr. de Andrade.
> >
> > Many thanks in advance for the help.
> >
> > Ron Modesitt
> >
> >
> >
> >
> >  
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
>
> --
> Stefan Vorkoetter
> Capable Computing, Inc.
> http://www.motocalc.com
>
> Small Things Aviation
> Electric R/C, Homebuilt, and General Aviation
> http://www.stefanv.com
>