On 7/5/07, John Labenski <[EMAIL PROTECTED]> wrote:
> On 7/3/07, Marcos <[EMAIL PROTECTED]> wrote:
> > 1)
> > wxLua: Expected a wxArrayString or table of strings for parameter 6,
> > but table index 1 is 'number'.
> > This error occurs when I passed a lua table with number ({1,2,3,4})
> > to combobox.
> >
> > 2)
> > When I set wxLabel title = 1, I get same error (string expected).
> > wxLua: Expected a string or wxString for parameter 2, but got 'number'.
> >
> > In previous versions it's ok.
> >
> > This is a serious problem when I work with sql databases
> > returning numbers.
> > How can I do this?
>
> There had to be a change in the way wxLua handles function arguments
> in order for overloaded functions to work. It had to be stricter to
> determine which C++ function to call since C++ does not automatically
> translate numbers to strings.
>
> For single numbers you can use tostring(), for tables, maybe just
> create a little helper function to convert the table values to
> strings, either returning the original translated table or a new table
> as appropriate.

Actually, on second thought I should loosen the restriction on the lua
table to wxArrayInt/String conversion. I'll allow lua to try to coerce
the value since we don't currently try to differentiate between a
table of ints/strings -> wxArrayInt/String for function overloading
determination. However, the only reason we don't is because so far
there aren't any functions that take all the same parameters except
for one that can either be a wxArrayInt/String. If that should
happen... then I dunno, maybe just %rename one of them so they won't
be ambiguous.

Regards,
    John Labenski

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to