Re: Setting new date with offset in days




"Dr J R Stockton" <reply0925@xxxxxxxxxxxxxxxxxx> wrote in message
news:TTmzGzIRl8NKFwYR@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In comp.lang.javascript message <fXuZl.1143$P5.992@xxxxxxxxxxxxxxxxxxxx>
, Mon, 15 Jun 2009 16:48:11, Paul E. Schoen <pstech@xxxxxxxxx> posted:

It seems that JavaScript or JScript is best used in a web
browser environment, or when necessary in PDFs where VBA is not
supported.
Otherwise probably VBS would be better for utility scripts that run on
the
WSH.

VBS is much more commonly used; that does not mean that it is actually
better. It does mean that there are more experts in the WSH VBS groups
than in the WSH JS ones.

Is there a group for the WSH?

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().

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

In another article :

But I still prefer to use Borland Delphi for most things that run on
the local machine.

Very wise; though, for work within its capability, Borland Pascal 7
DOS/DPMI mode is nicer. See sig,

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().

As discussed in the Turbo Pascal FAQ
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip>, the bottom line is really
all about accomplishing a needed task in the most efficient manner
possible, with the criteria of portability, time to program, and ease of
use being most important. But for purists it is much more about the
language itself, elegance, programming style, and other factors which are
process oriented rather than results oriented.

Thanks,

Paul


.



Relevant Pages

  • Re: Scripting file types
    ... If you're writing a quick and dirty script I might agree the .vbs file is ... The .wsf file has tags for an automatic help window with automatic text ... What is a .wsh file? ...
    (microsoft.public.scripting.vbscript)
  • Re: WSH Where to find it? And is it RichTxt32-like trouble maker?
    ... CScript.exe - that run a script. ... WSHOM.OCX, VBScript.dll, JScript.dll, ... pre-installed support running VBS and JS files. ... more up-to-date than BAT files when they started using Windows. ...
    (microsoft.public.vb.winapi)
  • Why doesnt this work
    ... I have read that the srcipting engine used in most browsers, ... is the same engine used in WSH. ... of a .vbs script which tests a system and reports the version of WSH that is ... I have slightly altered this and placed it into a web page script like this: ...
    (microsoft.public.scripting.wsh)
  • Indexzahl
    ... ich habe ein VBS Script das mit WMI Classes arbeitet. ... Ich bin noch ein Anfänger in WSH aber bei andere Sprachen ... Meine Frage ist ob man mit VBS auch eine Rechnung machen ...
    (microsoft.public.de.german.scripting.wsh)
  • Re: Where to find a COMPLETE VBScript reference?
    ... calls Shell32.dll ShellExecute behind the scenes. ... > would need to use in the web page VBScript to interact with the .EXE ... >> VBScript or WSH. ... If you want to script, say, Outlook or Word ...
    (microsoft.public.scripting.vbscript)