PDA

View Full Version : Get error from LUA when trying to use strlen()



mlemartien
December 19th, 2005, 04:57 AM
Hi there,

I initially post that message because of troubles I had when testing the DVDSpy samples but it sounds like my problem is really basic.

If I use a basic strlen() function in a LUA chunk, I get this error message:
[string "C:\Program Files\girder\DVD2LCD2.GML:\Displ..."]:2: attempt to call global `strlen' (a nil value)
stack traceback:
[string "C:\Program Files\girder\DVD2LCD2.GML:\Displ..."]:2: in main chunk

It must be very basic and I guess I'd same problem with other basic functions but I really can't figure out what I did wrong :oops:

Is there any prefix to add or library to declare or plugins to load in order to have those functions available.

Thanks in anticipation for any help cause I'm really stuck :(

Thanks,
J.

Ron
December 19th, 2005, 08:39 AM
that is lua 4 code.

Lua 5 is a little different

string.len(...) is what you are looking for.

mlemartien
December 19th, 2005, 08:45 AM
that is lua 4 code.

Lua 5 is a little different

string.len(...) is what you are looking for.

That does the trick indeed :D

Thank you so much. I've been confused by the fact that DVDSpy 2.X examples still use strlen.