cscase
October 19th, 2013, 19:58
Hey all,
Doing some work today and here's a problem I often struggle with. It seems like there's just some simple thing that I'm missing, and I'm hoping one of you can tell me what it is.
Suppose I have two... windowlists, for example, on the same sheet. How can I have one of them call a function for the other? That is, syntactically, how do I write that reference? Let me set up a simple example:
<windowlist name="ItemA">
...whatever is in the windowlist here, doesn't matter...
<script>
function doSomeStuff()
Debug.chat("doing some stuff");
end
</script>
</windowlist>
<windowlist name="ItemB">
...bla bla...
<script>
function onInit()
RIGHT HERE
end
</script>
</windowlist>
In this example, say in the second part, I want to call the doSomeStuff() function in ItemA. What's the correct syntax to use to do that? This seems like it's probably a dumb question, like it's something really minor that I'm missing. If I say "ItemA.doSomeStuff()" I get an error, because ItemA is not a global. I understand what that error means and I understand the problem is one of scope, because ItemA is not globally visible. I just don't know the proper way to specifically reference ItemA by its location. I have tried using a relative reference, by saying ".ItemA.doSomeStuff()", but that seems to be invalid here. Maybe that style of reference is only valid for db nodes? Can somebody hit me over the head with some illumination?
Doing some work today and here's a problem I often struggle with. It seems like there's just some simple thing that I'm missing, and I'm hoping one of you can tell me what it is.
Suppose I have two... windowlists, for example, on the same sheet. How can I have one of them call a function for the other? That is, syntactically, how do I write that reference? Let me set up a simple example:
<windowlist name="ItemA">
...whatever is in the windowlist here, doesn't matter...
<script>
function doSomeStuff()
Debug.chat("doing some stuff");
end
</script>
</windowlist>
<windowlist name="ItemB">
...bla bla...
<script>
function onInit()
RIGHT HERE
end
</script>
</windowlist>
In this example, say in the second part, I want to call the doSomeStuff() function in ItemA. What's the correct syntax to use to do that? This seems like it's probably a dumb question, like it's something really minor that I'm missing. If I say "ItemA.doSomeStuff()" I get an error, because ItemA is not a global. I understand what that error means and I understand the problem is one of scope, because ItemA is not globally visible. I just don't know the proper way to specifically reference ItemA by its location. I have tried using a relative reference, by saying ".ItemA.doSomeStuff()", but that seems to be invalid here. Maybe that style of reference is only valid for db nodes? Can somebody hit me over the head with some illumination?