How to use the self() command?
Posted: 30 Jan 2026 01:26
My goal in the short term, is to create a log file for my script based on the name of that script, My code started with:
$LogFile=<xyscripts> + self("base") + ".log";
so that it should appear in my XYScripts directory
but soon found out that wasnt working as expected. I am running the script from the 'Catalog', and I can see from the bit of code that is in the help file that self() seems meant to be rather versatile based even on the subroutine that it is called from.
The other thing that seemed strange to me was that my line of code above produced a filename of '0', so, not only did self("base") not point to where I thought it was pointing to, it sucked the string from <xyscripts> and ".log" into the void as well, leaving me with just '0' in the directory where I ran the script.
What am I doing wrong?
$LogFile=<xyscripts> + self("base") + ".log";
so that it should appear in my XYScripts directory
but soon found out that wasnt working as expected. I am running the script from the 'Catalog', and I can see from the bit of code that is in the help file that self() seems meant to be rather versatile based even on the subroutine that it is called from.
The other thing that seemed strange to me was that my line of code above produced a filename of '0', so, not only did self("base") not point to where I thought it was pointing to, it sucked the string from <xyscripts> and ".log" into the void as well, leaving me with just '0' in the directory where I ran the script.
What am I doing wrong?