lua-users home
lua-l archive

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


On Mon, Sep 10, 2012 at 1:47 AM, Rena <hyperhacker@gmail.com> wrote:

> Well, label_exists("::foo::") (or ::bar::) would still fail both of those
> cases, plus would find the very line doing the search if it's in the same
> file.

I agree that would fail if I were using your example pseudo-code. But I'm not.

I'm beginning from a string variable that may or may not include
characters used in the search pattern. At run-time, the code slices
and dices that string variable to strip any spaces and then add the
label punctuation to create the search pattern. The variable provides
the search pattern, not a literal string.

So when searching the script's plain text fetched and stored at
run-time in another variable, the search pattern will not be found
unless it matches a goto label existing in the plain text. The search
is looking for a literal string matching a variable's value, not for
the variable's name.

The code appended to my last reply to you works.

Best regards,

Paul