Setting new date with offset in days

D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
, Tue, 16 Jun 2009 19:45:06, Paul E. Schoen <[email protected]> posted:



Is there a group for the WSH?

The Usenet mechanism distributes
<<<and you can ask Google Groups about the sub-hierarchy.

My main criterion for saying VBS is better is only because it seems to
offer more capability within the WSH environment. Particularly I want the
ability to accept user input via an InputBox() or prompt().

It does appear to be missing.
And a
JScript can access the FSO to do file operations using the WSH, and it uses
a WScript.echo() as a replacement for prompt().

Not equivalent, though.

My confusion has probably been based more on the peculiarities of the WSH
and supported objects, than the JavaScript or JScript language itself.
Plausible.



I would assume, however, that the program generates an MSDOS executable
that runs in a DOS window.

Yes, except that one has both the 32-bit Command Prompt window and the
16-bit MS-DOS Prompt one. I keep one open for such purposes, and for
batch tools.
 
P

Paul E. Schoen

Dr J R Stockton said:
In comp.lang.javascript message <[email protected]

The Usenet mechanism distributes
<<<and you can ask Google Groups about the sub-hierarchy.

Unfortunately my new Verizon News server does not carry them. But there's
always google groups.
Not equivalent, though.

Yes, I meant alert(). It is missing any equivalent for prompt().

Yes, except that one has both the 32-bit Command Prompt window and the
16-bit MS-DOS Prompt one. I keep one open for such purposes, and for
batch tools.

I did not realize there was a difference. I found this resource interesting
and helpful:
http://commandwindows.com/command1.htm

I was also amazed at the many commands that are available, and there is a
link to the Microsoft XP Pro documentation for command line reference. But
there is still no equivalent to prompt() for accepting user input text. It
does allow pause but accepts any key. I suppose one could use "copy con:
textfile" and then use the text in that file for some purpose, but
generally the only way to supply user input is in the command line
parameters when the batch file is invoked.

Thanks,

Paul
 
M

Michael J. Ryan

Is there a group for the WSH?

probably in the microsoft.* tree, they aren't always widely distributed.
My main criterion for saying VBS is better is only because it seems to
offer more capability within the WSH environment. Particularly I want the
ability to accept user input via an InputBox() or prompt(). It seems odd
that the WSH will provide that ability for a VB script but not for a JS
script, even though I believe the same application is used for both. And a
JScript can access the FSO to do file operations using the WSH, and it uses
a WScript.echo() as a replacement for prompt().

Any functionality in VBScript is available in JScript, though with differing
syntax. Also COM enumerations/collections need to be wrapped in a special
enumerator object, which privides .first/next/last type functionalities.
I would assume, however, that the program generates an MSDOS executable
that runs in a DOS window. This is not so terrible, but I like the idea of
using the Windows GUI which is offered by scripting. For very simple
windows automation, such as saving a list of files to a folder, I could
just as well use a .BAT file. That was the purpose of a .JS script I wrote
some time ago. But I was surprised to find that the WSH did not provide any
form of user text input. And it was also a surprise to find that Nitro PDF
used a different set of objects that included the usual alert() but
substituted response() for prompt().

strLine = WScript.StdIn.ReadLine()
WScript.Echo("Read the line\"" + strLine + "\"")

http://www.devguru.com/Technologies/wsh/quickref/wscript.html

When you execute js in wsh via cscript.exe (console) there are exposed methods
for input/ouput. Honestly, a lot of the windows automation guys have moved to
powershell though.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
Unfortunately my new Verizon News server does not carry them. But there's
always google groups.

Both (ex-Motzarella) and
carry them, and are free.

I did not realize there was a difference. I found this resource interesting
and helpful:
http://commandwindows.com/command1.htm

You might also look via my sig.
I was also amazed at the many commands that are available, and there is a
link to the Microsoft XP Pro documentation for command line reference. But
there is still no equivalent to prompt() for accepting user input text.

Googling for what I considered obvious yesterday, I found a solution; I
cannot find it today. It involved a subroutine that wrote an explicit
new window containing suitable HTML and maybe code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,098
Messages
2,570,625
Members
47,236
Latest member
EverestNero

Latest Threads

Top