Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #10097

Re: JScript - WScript output similar to CScript output>

From Dr J R Stockton <reply1202@merlyn.demon.co.uk>
Newsgroups microsoft.public.scripting.jscript, microsoft.public.scripting.vbscript, comp.lang.javascript
Subject Re: JScript - WScript output similar to CScript output>
Date 2012-01-09 23:45 +0000
Organization Home
Message-ID <X9E62zggw3CPFwnp@invalid.uk.co.demon.merlyn.invalid> (permalink)
References (4 earlier) <je1ocf$e6m$1@dont-email.me> <BgivRqI0ggBPFwNs@invalid.uk.co.demon.merlyn.invalid> <847ebf0b-4938-4a1e-a108-964535d3d853@z12g2000yqm.googlegroups.com> <dbkY$XKhTLCPFwFa@invalid.uk.co.demon.merlyn.invalid> <a46fb17c-5638-4b1a-8d87-034ca257435e@p16g2000yqd.googlegroups.com>

Cross-posted to 3 groups.

Show all headers | View raw


In comp.lang.javascript message <a46fb17c-5638-4b1a-8d87-034ca257435e@p1
6g2000yqd.googlegroups.com>, Sun, 8 Jan 2012 14:52:24, "Michael Haufe
(TNO)" <tno@thenewobjective.com> posted:

>On Jan 7, 3:10 pm, Dr J R Stockton <reply1...@merlyn.demon.co.uk>
>wrote:
>> In comp.lang.javascript message <847ebf0b-4938-4a1e-a108-964535d3d853@z1
>> 2g2000yqm.googlegroups.com>, Thu, 5 Jan 2012 22:05:53, "Michael Haufe
>> (TNO)" <t...@thenewobjective.com> posted:
>>
>> >Are you looking for a formatted table output in the command window in
>> >a way similar to your original example?
>>
>> Yes.
>>
>> The original article in the thread was concerned with one particular
>> point.  That example was partly from what I already have, with the third
>> column by hand.  It will be to produce something similar but with other
>> information.
>
>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.

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

JScript - is a file of a known Type? Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-03 17:09 +0000
  Re: JScript - is a file of a known Type? "Mayayana" <mayayana@invalid.nospam> - 2012-01-03 21:13 -0500
    Re: JScript - is a file of a known Type? Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-04 00:55 -0500
      Re: JScript - is a file of a known Type? "Mayayana" <mayayana@invalid.nospam> - 2012-01-04 09:18 -0500
        Re: JScript - is a file of a known Type? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2012-01-04 09:40 -0500
          Re: JScript - is a file of a known Type? "Mayayana" <mayayana@invalid.nospam> - 2012-01-04 10:23 -0500
            Re: JScript - is a file of a known Type? Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-04 20:22 -0500
            Re: JScript - is a file of a known Type? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-05 22:01 -0800
              Re: JScript - is a file of a known Type? John G Harris <john@nospam.demon.co.uk> - 2012-01-06 11:04 +0000
                Re: JScript - is a file of a known Type? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-06 04:26 -0800
                Re: JScript - is a file of a known Type? John G Harris <john@nospam.demon.co.uk> - 2012-01-06 14:58 +0000
                Re: JScript - is a file of a known Type? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-06 12:27 -0800
              Re: JScript - is a file of a known Type? Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 21:54 +0000
          JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-05 20:29 +0000
            Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-05 22:05 -0800
              Re: JScript - WScript output similar to CScript output> Bwig Zomberi <zomberiMAPSONNOSPAM@gmail.invalid> - 2012-01-06 14:31 +0530
                Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 21:14 +0000
              Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 21:10 +0000
                Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-08 14:52 -0800
                Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-09 23:45 +0000
                Re: JScript - WScript output similar to CScript output> Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-10 00:27 -0500
                Re: JScript - WScript output similar to CScript output> Dr J R Stockton <J.R.Stockton@physics.org> - 2012-01-10 13:40 -0800
                Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-10 17:04 -0800
                Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-12 23:43 +0000
                Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-12 22:36 -0800
                Re: JScript - WScript output similar to CScript output> "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-12 22:47 -0800
                Re: JScript - WScript output similar to CScript output> Dr J R Stockton <J.R.Stockton@physics.org> - 2012-01-14 12:15 -0800
            Re: JScript - WScript output similar to CScript output> Bwig Zomberi <zomberiMAPSONNOSPAM@gmail.invalid> - 2012-01-06 14:43 +0530
            Re: JScript - WScript output similar to CScript output> Todd Vargo <tlvargo@sbcglobal.netz> - 2012-01-06 05:20 -0500
              Re: JScript - WScript output similar to CScript output> "Mayayana" <mayayana@invalid.nospam> - 2012-01-06 08:33 -0500
                Re: JScript - WScript output similar to CScript output> Dr J R Stockton <reply1201@merlyn.demon.co.uk> - 2012-01-07 20:11 +0000

csiph-web