From: Mayayana on
|
| *Some* constants are defined.

Thanks. I didn't know about that. I'm guessing
it must be "new" with XP. I'm curious where that's
coming from. Both scrrun.dll and wshom.dll refer
to some constants in their type libraries, but those
are not the same constants mentioned in the help.
For instance, I don't see where WSH finds the value
for "vbSaturday". It doesn't seem to be hard-coded into
wscript/cscript.


From: ekkehard.horner on
Mayayana schrieb:
> |
> | *Some* constants are defined.
>
> Thanks. I didn't know about that. I'm guessing
> it must be "new" with XP. I'm curious where that's
> coming from. Both scrrun.dll and wshom.dll refer
> to some constants in their type libraries, but those
> are not the same constants mentioned in the help.
> For instance, I don't see where WSH finds the value
> for "vbSaturday". It doesn't seem to be hard-coded into
> wscript/cscript.
>
>
If you don't want to speculate, use something like this:

Option Explicit

WScript.Echo "working with:", GetVersionsInfo()

Dim aNames : aNames = Array( _
"vbTextCompare", "vbYesNo" _
, "vbSunday", "vbMittwoch" _
, "ForReading" _
, "xlCrashWithPicture" _
)
Dim sName
For Each sName In aNames
If vbEmpty <> Eval( "VarType( " + sName + " )" ) Then
WScript.Echo sName, Eval( sName )
Else
WScript.Echo sName, "is undefined"
End If
Next

Function GetVersionsInfo()
GetVersionsInfo = Join( Array( _
Replace( _
CreateObject( "Wscript.Shell" ).Exec( "%comspec% /c ver"
).Stdout.ReadAll() _
, vbCrLf _
, "" _
) _
, Join( Array( _
WScript.Name, WScript.Version _
), " " ) _
, Join( Array( _
ScriptEngine _
, Join( Array( _
ScriptEngineMajorVersion, ScriptEngineMinorVersion,
ScriptEngineBuildVersion _
), "." ) _
), " " ) _
), " * " )
End Function

to make sure which constants are defined.

Some output:

DOS M:\trials\23forum
cscript checkConstants.vbs

working with: Microsoft Windows XP [Version 5.1.2600] * Windows Script
Host 5.7 * VBScript 5.7.16599
vbTextCompare 1
vbYesNo 4
vbSunday 1
vbMittwoch is undefined
ForReading is undefined
xlCrashWithPicture is undefined

working with: Microsoft Windows 2000 [Version 5.00.2195] * Windows
Script Host 5.6 * VBScript 5.6.6626
vbTextCompare 1
vbYesNo 4
vbSunday 1
vbMittwoch is undefined
ForReading is undefined
xlCrashWithPicture is undefined
From: Todd Vargo on
Mayayana wrote:
> |
> | *Some* constants are defined.
>
> Thanks. I didn't know about that. I'm guessing
> it must be "new" with XP. I'm curious where that's
> coming from. Both scrrun.dll and wshom.dll refer
> to some constants in their type libraries, but those
> are not the same constants mentioned in the help.
> For instance, I don't see where WSH finds the value
> for "vbSaturday". It doesn't seem to be hard-coded into
> wscript/cscript.

Intrinsic constants can be readily found in screnc.chm help.

Type "constants" in the index search box to see them by category or type
"vb" in the box to move down to the vb... names which are listed directly
within the index.

--
Todd Vargo

(Post questions to group only. Remove "z" to email personal messages)

From: Todd Vargo on

"Todd Vargo" <tlvargo(a)sbcglobal.netz> wrote in message
news:eyWZf68FLHA.1996(a)TK2MSFTNGP06.phx.gbl...
> Mayayana wrote:
>> |
>> | *Some* constants are defined.
>>
>> Thanks. I didn't know about that. I'm guessing
>> it must be "new" with XP. I'm curious where that's
>> coming from. Both scrrun.dll and wshom.dll refer
>> to some constants in their type libraries, but those
>> are not the same constants mentioned in the help.
>> For instance, I don't see where WSH finds the value
>> for "vbSaturday". It doesn't seem to be hard-coded into
>> wscript/cscript.
>
> Intrinsic constants can be readily found in screnc.chm help.

I meant Script56.chm above.

>
> Type "constants" in the index search box to see them by category or type
> "vb" in the box to move down to the vb... names which are listed directly
> within the index.
>
> --
> Todd Vargo
>
> (Post questions to group only. Remove "z" to email personal messages)

From: Mayayana on

| I meant Script56.chm above.
|
Yes, I found those. I was just curious where
WSH is getting them from.