In comp.lang.javascript message <a46fb17c-5638-4b1a-8d87-034ca257435e@p1
6g2000yqd.googlegroups.com>, Sun, 8 Jan 2012 14:52:24, "Michael Haufe
(TNO) said:
So did my sample code work help at all?
Completely. But with the apparent peculiarity that extension $$$ (my
editor's backup) is known to the registry, although the corresponding
..Type string is "$$$ File", similar to that for a file with extension
OK4 which is not so known.
Aside to non-Anglos :
What would the .Type property be for an unregistered file in
systems set for other well-known Western European languages?
E.g. Fichier OK4 / OK4 Fichier, etc.? Users are required to be
able to read instructions in English, but should not be required
to have an English-speaking Windows.
But the core of the situation is that all CScript output is through
function Right(N, Str) { N = Hush[N]
if (N == "0") return
if (N == "1") WScript.StdOut.Write(Str)
if (N == "2") WScript.StdErr.Write(Str)
if (N == "3") txtStreamOut.Write(Str)
}
in which almost all Str end with a newline; and I want to use
if (N == "4") SOMETHING(Str)
[ after having detected (which I can do) WScript ] to get a
corresponding display.
If that can be done, the application is no longer just a CScript
application usable only by those who can find and use a DOS-like command
line, but it is usable also by those who only use GUI routines.
So to check if I understand correctly, you want a function that will
take a collection of results in the format of:
FILENAME TYPE KNOWN
and display them as a formatted table in CScript or as an HTML table
in a generated HTA in WScript?
Not really; you are going further that I wish for.
I wanted a routine that would accept text, a line at a time (P.S. to be
strictly accurate, these lines could contain newlines), and cause it to
appear as it would in Notepad. The example is tabular, but other lines
are not. To illustrate, here's a command-prompt screen capture :
prompt>seek . n
:: SEAKFYLE.JS >= 2012-01-09, at 2012-01-09 20:21:56, see SEAKFYLE.HTM
2012-01-09 17:40:34 33275 .....a.. "SEAKFYLE.$$$"
2012-01-09 17:41:00 33291 .....a.. "SEAKFYLE.HTM"
2012-01-09 17:38:37 17603 .....a.. "SEAKFYLE.JS"
| Date/time now : 2012-01-09 20:21:56
| Find : 3 matches
| Finding in : C:\WSH\SEEK ; 31 ms
If I do the following command line, nothing appears in the screen before
the next prompt, as Q sets all output to Channel 3 which is sent To file
xyz.
prompt>seek . n Q333333 Txyz
and file xyz. can be opened in Notepad (except for needing an 0D before
each 0A, which can be dealt with (most easily by using WFVIEW instead)).
Aside : AFAICS, no GUI editor or viewer that I have can AFAIK accept
piped-in text, which is a pity.
What I want to end up with is using essentially the same code as I have
at present, but as a GUI application - instead of opening a Command
Prompt and giving it a Command Line, to open a GUI window and give it,
with some equivalent of a JavaScript prompt(), the commands. Or just
command-line in, GUI out.
I forgot to say that the GUI needs to show each line as it is output
from the current code, without waiting for the stream to complete.
The alternative seems to be to use an HTA, treating my existing code as
an include file of functions and variables, and suppressing any unwanted
parts. That should be easy, if I learn about HTAs first - - - which I
seem to have done.
It's now fundamentally working in an HTA, but the adapting needs to be
cleaned up, though not tonight.