Lua question.

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

Lua question.

Pal-3
I believe this is strictly a Lua question, but I was hoping someone here could help.

I would like to create my own function for placing labels on the screen in a convenient
way:
...

function pr(x,y,t,f)

 screen.moveto(x,y)
 screen.font(f)
 print(t)

end


pr(1,15,"hello, world",1)
...

I keep receiving error messages like: "argument #1 to 'font' (number expected, got nil)".

I've run various other tests in which I print 'f' versus passing it to screen.font(), and it
works fine.



Thanks,
Pal


Reply | Threaded
Open this post in threaded view
|

Re: Lua question.

Berkant Atay
Hi,

I typed in my Treo650 the same code you have given,
and it worked as expected, no problems... (Plua 2.09b)
(I have other fonts, YAHM, and FontHackV)


--- Pal <[hidden email]> wrote:

> I believe this is strictly a Lua question, but I was
> hoping someone here could help.
>
> I would like to create my own function for placing
> labels on the screen in a convenient
> way:
> ...
>
> function pr(x,y,t,f)
>
>  screen.moveto(x,y)
>  screen.font(f)
>  print(t)
>
> end
>
>
> pr(1,15,"hello, world",1)
> ...
>
> I keep receiving error messages like: "argument #1
> to 'font' (number expected, got nil)".
>
> I've run various other tests in which I print 'f'
> versus passing it to screen.font(), and it
> works fine.
>
>
>
> Thanks,
> Pal
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Lua question.

Berkant Atay
In reply to this post by Pal-3
I have disabled YAHM, just in case, and it again
worked all right..

Sorry, this didn't help too much.


--- Pal <[hidden email]> wrote:

> I believe this is strictly a Lua question, but I was
> hoping someone here could help.
>
> I would like to create my own function for placing
> labels on the screen in a convenient
> way:
> ...
>
> function pr(x,y,t,f)
>
>  screen.moveto(x,y)
>  screen.font(f)
>  print(t)
>
> end
>
>
> pr(1,15,"hello, world",1)
> ...
>
> I keep receiving error messages like: "argument #1
> to 'font' (number expected, got nil)".
>
> I've run various other tests in which I print 'f'
> versus passing it to screen.font(), and it
> works fine.
>
>
>
> Thanks,
> Pal
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Lua question.

Pal-3
Thank you, Berkant. I have no idea what I did, but after you said it worked on your
machine I re-wrote my functions and now they work. I MUST have had some improper
syntax or something. I spent much time on that since it was not working, but seemed
pretty straightforward.

Oh well.

Thanks,
Pal

--- In [hidden email], Berkant Atay <berkant_atay@...> wrote:

>
> I have disabled YAHM, just in case, and it again
> worked all right..
>
> Sorry, this didn't help too much.
>
>
> --- Pal <greenchile505@...> wrote:
>
> > I believe this is strictly a Lua question, but I was
> > hoping someone here could help.
> >
> > I would like to create my own function for placing
> > labels on the screen in a convenient
> > way:
> > ...
> >
> > function pr(x,y,t,f)
> >
> >  screen.moveto(x,y)
> >  screen.font(f)
> >  print(t)
> >
> > end
> >
> >
> > pr(1,15,"hello, world",1)
> > ...
> >
> > I keep receiving error messages like: "argument #1
> > to 'font' (number expected, got nil)".
> >
> > I've run various other tests in which I print 'f'
> > versus passing it to screen.font(), and it
> > works fine.
> >
> >
> >
> > Thanks,
> > Pal
> >
> >
> >
>