Jump to content

Lua I/O library


me2d09

Recommended Posts

I started a new thread, because posts in this topic are little bit OT.

I have made a small Lua-file for testing. It has only one media (txt-file). If you start the cartridge with the emulator, you should see the abc in a MessageBox and in the Lua debug of the emulator. If you start it on the garmin, you will get an "Unexpected error / Closing cartridge".

I have done some research with my Oregon. Firstly: Unexpected error you gets with your test gwc is not thrown on line:

fileHandle = io.open(fileName,"r")

so io.open command is implemented (!) in oregon.

But bad news: this command is unable to open file. Lua function io.open returns a new file handle, or, in case of errors, nil plus an error message.

And on Oregon, it always returns nil and on the second parametr is:

deutsch.txt: No error (errno = 0)

You can test it with command:

fileHandle,err = io.open(fileName,"r")

So there is no error :). It looks like a joke from Garmin developers :).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...