Get Label of current ($) Item /Question

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
disala
Posts: 9
Joined: August 27th, 2016, 9:47 pm

Get Label of current ($) Item /Question

Post 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
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

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

Post 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.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

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

Post 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,
G.VOLNY, a CSProuser from Haiti, since 2004
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

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

Post by aaronw »

Sorry this is not currently in the works for CSPro 7.4.
lmangcahan
Posts: 25
Joined: September 7th, 2021, 3:45 am

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

Post 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));
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

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

Post 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.
Post Reply