How do i include libraries? are there any that i can use? - LUA Scripting - CHDK Forum supplierdeeply

How do i include libraries? are there any that i can use?

  • 3 Replies
  • 2371 Views
How do i include libraries? are there any that i can use?
« on: 24 / November / 2008, 00:23:31 »
Advertisements
I attempted to make use of the string.sub function and it seems that i need to import the string library. where do i find such a thing? does it need to be built particularly for my camera? it appears that lua libs are build for each os.

putting

require("string")

at the top of my script results in an error saying that the string lib can't be found.

---

other than that, i'm really exciting about lua in chdk!

*

Offline reyalp

  • ******
  • 12934
Re: How do i include libraries? are there any that i can use?
« Reply #1 on: 24 / November / 2008, 01:05:08 »
The string lib needs some C functions that are not currently available in CHDK, so it is #ifdef'd out of CHDKs lua implementation.

It is on my list of things to do. Once it is done, it will be automatically available like os and io, no need to require it. Require is only for libraries written in lua (or implemented in shared libraries, but CHDK doesn't have that capability either)
Don't forget what the H stands for.

Re: How do i include libraries? are there any that i can use?
« Reply #2 on: 24 / November / 2008, 23:42:48 »
thanks for the quick response

*

Offline reyalp

  • ******
  • 12934
Re: How do i include libraries? are there any that i can use?
« Reply #3 on: 30 / November / 2008, 02:06:01 »
string lib checked in. As usual, I suggest running llibtst.lua before you try to use it.
Don't forget what the H stands for.


 

Related Topics