Re: Extracting data from an XML to put into a constant
- From: "Paul Randall" <paulr901@xxxxxxxxxxxx>
- Date: Tue, 25 Mar 2008 16:22:01 -0600
"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:Op%23rPHrjIHA.1168@xxxxxxxxxxxxxxxxxxxxxxx
Paul Randall wrote:
"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:%23Uwu$tpjIHA.248@xxxxxxxxxxxxxxxxxxxxxxx
mr_unreliable wrote:
Bob Barrows [MVP] wrote:Interesting, but I don't understand the relevance. You don't seem
Well, you cannot set a contant's value at runtime: constants can
only be set at compile time,
If one is willing to use the "wsf" construct, then one may
access the constants in an object's typelib by using the
"reference tag".
Here is an example:
--- <code> ---
<job>
<reference object="Excel.***.8" />
<script language="VBScript">
MsgBox("test XL ref. xlTextFormat = " & CStr(xlTextFormat))
</script>
</job>
--- </code> ---
Copy out the code into a file, and name it "testXLConstant.wsf".
to
be
talking about setting a constant's value at runtime.
If it is not 'runtime', what time context is the <reference object=
...> construct running in?
I don't know, I've never seen this before. You tell me.
Ok, so you don't know either. Why don't you suspect this type
I suspect that behind the scenes, it is doing something similar
what I
do in the DefineConstants routine I posted last year, but maybe not
in
the same time context.
library
isn't being accessed at the script's compile time? Similar to what
occurs when setting a reference to a type library in VB?
You are correct -- I don't know. I don't have a reference that
discusses the process of 'running' a .vbs or .wsf file. I'm trying to
create a model in my mind that seems to be consistent with what I see.
I appreciate your input.
In the following example
<job>
<script language="VBScript">
MsgBox("test XL ref. TristateUseDefault = " &
CStr(TristateUseDefault))
</script>
<reference object="wscript.shell" />
</job>
the value of TristateUseDefault is known to the script which indicates
some prescan mechanism is occurring. Having played with multiple
<script > ... </script> blocks in HTAs, I think that each block has
its own prescan, but perhaps the <job>...</job> block has a prescan
too.
-Paul Randall
.
- Follow-Ups:
- Re: Extracting data from an XML to put into a constant
- From: Paul Randall
- Re: Extracting data from an XML to put into a constant
- References:
- Extracting data from an XML to put into a constant
- From: wills.jason@xxxxxxxxx
- Re: Extracting data from an XML to put into a constant
- From: Bob Barrows [MVP]
- Re: Extracting data from an XML to put into a constant
- From: mr_unreliable
- Re: Extracting data from an XML to put into a constant
- From: Bob Barrows [MVP]
- Re: Extracting data from an XML to put into a constant
- From: Paul Randall
- Re: Extracting data from an XML to put into a constant
- From: Bob Barrows [MVP]
- Extracting data from an XML to put into a constant
- Prev by Date: Re: Extracting data from an XML to put into a constant
- Next by Date: Re: Extracting data from an XML to put into a constant
- Previous by thread: Re: Extracting data from an XML to put into a constant
- Next by thread: Re: Extracting data from an XML to put into a constant
- Index(es):
Loading