Page 1 of 1

Retrieving the label's caption?

Posted: 05 Jul 2017 17:04
by Filehero

Code: Select all

tagitems("label");
only returns the ID. Currently there's no way to retrieve a label's caption using SC, right?

Thanks,
FH

Re: Retrieving the label's caption?

Posted: 05 Jul 2017 17:50
by highend
Sure there is...

Code: Select all

    $labels = regexmatches(readfile("<xydata>\tag.dat", , 2000), "^((.+?)\|\|(.+?)){7,}$");
    $label  = gettoken(gettoken($labels, tagitems(), ";"), 1, "||");
If label definitions could have been edited, the tags must have been saved first,
otherwise the script could read old definitions

Re: Retrieving the label's caption?

Posted: 05 Jul 2017 18:06
by Filehero
highend wrote:

Code: Select all

    $labels = regexmatches(readfile("<xydata>\tag.dat", , 2000), "^((.+?)\|\|(.+?)){7,}$");
    $label  = gettoken(gettoken($labels, tagitems(), ";"), 1, "||");
I am t r u l y spoiled, darn. I wasn't even thinking of doing it myself after I didn't find any straight SC command. :moronicon:

Thanks a lot. :D

Re: Retrieving the label's caption?

Posted: 05 Jul 2017 18:59
by admin
Filehero wrote:

Code: Select all

tagitems("label");
only returns the ID. Currently there's no way to retrieve a label's caption using SC, right?

Thanks,
FH
Next version you can do this:

Code: Select all

echo tagitems("label", 3:=2);
echo tagitems(3:=2); //"label" is default anyway

Re: Retrieving the label's caption?

Posted: 05 Jul 2017 20:01
by Filehero
admin wrote:Next version you can do this:

Code: Select all

echo tagitems("label", 3:=2);
echo tagitems(3:=2); //"label" is default anyway
:tup: :tup: :tup:

/e:
Thanks for implementation in v18.00.0021 - 2017-07-06 20:14
:D