Using lua I/O libraries in scripting

140 views
Skip to first unread message

Andrew Spielberg

unread,
Sep 25, 2020, 5:05:08 PM9/25/20
to IceSL
I am trying to use the scripting engine to do a few things programmatically, and one thing that I need is the ability to load some data from a text (CSV) file.

I tried to open a file, and read, using the line:

for line in io.lines(filename) do

However, I received the error:

attempt to index global 'io' (a nil value)

Typically io is imported by default in lua.  Is there a way to import this?

-Andrew S.

Re-try WhenDown

unread,
Sep 25, 2020, 11:11:50 PM9/25/20
to IceSL
Hi Andrew.

Make sure the option called ‘Use IO Libraries’ is clicked before you use file routines.

You can find this under the Options Menu in the Menu bar of IceSL.

Salim

Le 25 sept. 2020 à 23:05, Andrew Spielberg <aespi...@gmail.com> a écrit :


--
You received this message because you are subscribed to the Google Groups "IceSL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icesl+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/icesl/20ee7f0c-4c3f-4fe5-a795-1b9bb58aa8fan%40googlegroups.com.

Andrew Spielberg

unread,
Sep 28, 2020, 11:54:59 AM9/28/20
to Re-try WhenDown, IceSL
Ah, that works; thank you!

-Andrew S.

You received this message because you are subscribed to a topic in the Google Groups "IceSL" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/icesl/VRN2nb4V7kc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to icesl+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/icesl/4E6F4380-D2FD-4924-AA22-B26CD3659D72%40gmail.com.
Reply all
Reply to author
Forward
0 new messages