Page 1 of 1

Get Label of current ($) Item /Question

Posted: January 14th, 2020, 8:59 pm
by disala
Dear all,

I need to write a global function to get label (Item Label) of an item. Outline of my function as follows

Code: Select all

PROC GLOBAL
function string getTextfromLabel ()
	getTextfromLabel =getlabel(???);
end; // getTextfromLabel
Where the place marked as “???” need dictionary object. (Item Name)

My question is how do I tell to take the current items ($) label and return it

Thanks in advance

Disala

Re: Get Label of current ($) Item /Question

Posted: January 15th, 2020, 9:53 am
by aaronw
This isn't currently possible. Getlabel's first parameter is a dictionary_symbol, which can only be passed in by explicitly referencing it or by using the $.

If in the the future we allow getlabel to accept the result of getsymbol this would be possible. Something we will consider.

Re: Get Label of current ($) Item /Question

Posted: January 15th, 2020, 10:48 am
by htuser
Very Good news for CSProusers.

Allow several CSPro logic function, among other Getlabel, to accept the result of Getsymbol or other dictionary symbol alias. This will boost our ability to design more advanced and dynamic user defined functions.

@ Aaron, do you think that we can have it in the next cut?

Thanks in advance,

Re: Get Label of current ($) Item /Question

Posted: January 16th, 2020, 12:09 pm
by aaronw
Sorry this is not currently in the works for CSPro 7.4.

Re: Get Label of current ($) Item /Question

Posted: June 26th, 2023, 5:26 am
by lmangcahan
Hello CSPro,

Is this possible now? I mean, I'm trying to get the dictionary_symbol dynamically from a query but I get the error "Dictionary object expected" when I use the getlabel function. By the way, I'm using v7.7.

Thank you.

string itemlabel = getlabel(col_roster_lst(x));

Re: Get Label of current ($) Item /Question

Posted: June 26th, 2023, 7:47 am
by Gregory Martin
Unfortunately, this is still not possible. It will also not be possible in CSPro 8.0, which will come out shortly, but we eventually will support such functionality. Sorry for the inconvenience.