self('caption')
and self('base')
report differently.Sorry, the code has to be split into multiple scripts, but I hope the
sysdebug
output helps map the call stack (N.B. I use '^^' to filter the output in DebugView).Put these 4 scripts into a single folder and then load script1.
script1.xys
Code: Select all
"script1init"
{
sysdebug '^^ DBGVIEWCLEAR';
sysdebug '^^ This is script1';
load '.\script2.xyi';
sysdebug '^^ In script1 : calling Script2Function';
Script2Function();
}
function Script1Callback()
{
sysdebug '^^ This is Script1Callback';
Script3Function();
}
Code: Select all
"script2init"
{
sysdebug '^^ This is script2';
load '.\script3.xyi';
load '.\script4.xyi';
}
function Script2Function()
{
sysdebug '^^ This is Script2Function';
Script1Callback();
}
Code: Select all
"script3init"
{
sysdebug '^^ This is script3';
}
function Script3Function()
{
sysdebug '^^ This is Script3Function';
text
'In Script3Function()' . <crlf> .
'====================' . <crlf> .
'self(caption): ' . <crlf> .
'self : ' . self('caption') . <crlf> .
'self -1: ' . self('caption', -1) . <crlf> .
'self -2: ' . self('caption', -2) . <crlf> .
'self -3: ' . self('caption', -3) . <crlf 2> .
'self(base): ' . <crlf> .
'self : ' . self('base') . <crlf> .
'self -1: ' . self('base', -1) . <crlf> .
'self -2: ' . self('base', -2) . <crlf> .
'self -3: ' . self('base', -3);
}
Code: Select all
"script4init"
{
sysdebug '^^ This is script4';
}
sysdebug
output is:which is what I expect. However, the script output is:[4992] ^^ This is script1
[4992] ^^ This is script2
[4992] ^^ This is script3
[4992] ^^ This is script4
[4992] ^^ In script1 : calling Script2Function
[4992] ^^ This is Script2Function
[4992] ^^ This is Script1Callback
[4992] ^^ This is Script3Function
The two sections are not consistent with each other. The first section is what I expect, but not the second – script4 is the last script that was loaded (in script2) but it has not called any subsequent code. I expect the second section to report:In Script3Function()
====================
self(caption):
self : function script3function
self -1: function script1callback
self -2: function script2function
self -3: script1init
self(base):
self : script4
self -1: script4
self -2: script4
self -3: script1
Have I misunderstood howself : script3
self -1: script1
self -2: script2
self -3: script1
self
works or is this a bug?