lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Aha! I haven't tested it yet, but I'm sure that's the answer. Thanks!

Clint
Lua Newbie

On Thursday, February 20, 2020, Michal Kottman <michal.kottman@gmail.com> wrote:
On Thu, Feb 20, 2020, 4:37 PM Clinton Reese <clinton.bruce.reese.1975@gmail.com> wrote:
As you can see below, I'm trying to use strsub(string, i) in a little program that is an attempt at building a very simple vm on top of Lua 5.3:.

This is the output that I get:

j10 m20
false is not equal to 'true.'
m20 false
push30 m30 executed.
x35 print.lua
j40 m50
true is equal to 'true.'
lua53: main.lua:34: attempt to call a nil value (local 'strsub')
stack traceback:
        main.lua:34: in main chunk
        [C]: in ?

strsub() does not exist in Lua 5.3. Did you mean to use string.sub()?

https://www.lua.org/manual/5.3/manual.html#pdf-string.sub