Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a variable that looks like below:
var1=Sum(Sales) /*Sales Amount*/
The variable is generated by the script and i would like to extract the value within /**/ which is "Sales Amount"
Let me know your thoughts..
Thxs,
Badr
Hello Badr,
It is the presence of the ' character that creates the problem. You can eliminate them from the equation using the PurgeChar() function:
var1=TextBetween(PurgeChar(var1, Chr(27)), '/*', '*/')
Regards,
Philippe
This is Multiline comment and once your run the script, you will lose them.
Hello Badr,
You could use the TextBetween() function as such:
=TextBetween('$(var1)', '/*', '*/')
Regards,
Philippe
hi there
you have to write in script like below
set vVar1='sum(Sales)/*sum amount */'
and in frontend or backend
=TextBetween('$(vVar1)', '/*', '*/')
or
replace(subfield('$(vVar1)',/*',2),'*/',null())
TextBetween works but if the variable has Num()around it it doesn't..
var1= Num(sum(Sales),'#,##0')/*Sales Amount*/
Not sure about the replace statement but it seems to be wrong.. Textbetween works but the issue if the variable has Num() function around the expression then it doesn't work.
Hello Badr,
It is the presence of the ' character that creates the problem. You can eliminate them from the equation using the PurgeChar() function:
var1=TextBetween(PurgeChar(var1, Chr(27)), '/*', '*/')
Regards,
Philippe
Thxs so much!