Is there a way to get a string which is the name of the variable passed in parameter of a function ?
I test the type ANY (__System.AnyType) which provides 3 fields (pointer to the value, value size and type class) but not the name of the value.
For example :
FUNCTIONfuncVAR_INPUTÂ Â info:ANY;END_VARVARÂ Â infoSize:DINT;Â Â infoTYPE:__SYSTEM.TYPE_CLASS;Â Â infoPointer:POINTERTOBYTE;Â Â infoName:STRING;END_VARinfoSize:=info.diSize;infoTYPE:=info.TypeClass;infoPointer:=info.pValue;infoName:=""//???????????????????????
func(GVL.myVar);
Now, I would like to retrieve, in my function func, the name of the variable "GVL.myVar".
I heard about __VARINFO, however I can't find a easy way to retrieve such an information.
Please help
Regards,
FG
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-09-07
Originally created by: flogir
The attribute 'parameterstringof' is only available in visu, it's to bad because it whould have solved the problem....
FUNCTIONfuncVAR_INPUTÂ Â info:ANY;END_VARVARÂ Â infoSize:DINT;Â Â infoTYPE:__SYSTEM.TYPE_CLASS;Â Â infoPointer:POINTERTOBYTE;Â Â {attribute'parameterstringof':='info'}Â Â infoName:STRING;END_VARinfoSize:=info.diSize;infoTYPE:=info.TypeClass;infoPointer:=info.pValue;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: flogir
Hello,
Is there a way to get a string which is the name of the variable passed in parameter of a function ?
I test the type ANY (__System.AnyType) which provides 3 fields (pointer to the value, value size and type class) but not the name of the value.
For example :
Now, I would like to retrieve, in my function func, the name of the variable "GVL.myVar".
I heard about __VARINFO, however I can't find a easy way to retrieve such an information.
Please help
Regards,
FG
Originally created by: flogir
The attribute 'parameterstringof' is only available in visu, it's to bad because it whould have solved the problem....
See this post
l viewtopic.php?p=14404#p14404 l
Varinfo gives to you class name and instance name.