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


Groups > comp.lang.javascript > #28678

Re: Optional printouts using flag?

Newsgroups comp.lang.javascript
Date 2015-09-11 02:55 -0700
References <c3ba3a04-f3c6-46e9-9689-0ded66ec999e@googlegroups.com> <XnsA51274157CFBBeejj99@194.109.6.166>
Message-ID <dda59467-a761-4d43-9dfe-e618369277bd@googlegroups.com> (permalink)
Subject Re: Optional printouts using flag?
From jonas.thornvall@gmail.com

Show all headers | View raw


Den fredag 11 september 2015 kl. 11:25:05 UTC+2 skrev Evertjan.:
> jonas.thornvall@gmail.com wrote on 11 Sep 2015 in comp.lang.javascript:
> 
> > Sometimes when programming one wants traces of operation to be printout,
> > to derive how a value was achieved, but in the general case one just
> > want the result out within form. 
> 
> I don't think so, why would you want "traces of operation" on paper?
> 
No i meant online in HTML form, let say you have a calculus system and you like to chose the detail level of presentation of the calculation. 

> Perhaps you mean you want to see it in the console.log?

No i want to be able to set a flag in the form that tell the detail level of printouts of variables and calculations.
 
> console.log('value of a is: ' + a);
> 
> > Is there a way to steer what rows should be interpretated/run by using a
> > flag. 
> 
> if (debug=='on') console.log('value of a is: ' + a);
> 
> > It would be neat if one could use a none Javscript symbol at start
> > of line 
> 
> What is a "none Javscript symbol"?
> A "non-Javascript symbol"? 
> A "known Javascript symbol"?

Well i was thinking of a reserved unicode ascii combination at start of row, for example &% could signify 0 and 1 and thus we could have a lot of optional execution paths  by set &=1 or &=0 for flagged execution.

Now we would have alot of optional executional choices that can be steered directly from form by reading a checkbox to set the flag for.

&,%,&%,%&,%%,&& and so on.
 

 
> 
> Javascript essentially has no start-of-line.
> The newline does not mean much.
> 
> Change the word "line" to "statement",
> where statement" could also be a group of consecutive statements within { }. 
> 
> 
> > and then use a bolean flag  to tell the interpretator if that
> 
> script-interpretor I would say.
> 
> > line should be interpretated or not. 
> 
> if (debug=='on') { }; 
> 
> > That way you could swithch between extensive printouts, or just result.
> 
> You clould also just disregard the console,
> or have your printer throw the paper directly into the trach-bin.
>   
> > How is this usually resolved in Javascript,
 
This is not just for debug purposes but to steer detail level of a calculation or a salary specificaion.

I do realise that it is probably a database query, but there must be alot of realtime systems nowadays that is overwatched from webinterfaces?

And there you may want to specify detail level of information for the process you want to study?


> By debugging, see above.
> 
> You can also set and use breakpoints with the Developer Tool [usually F12]
> 
> > is there any language that
> > support the kind of behaviour i suggest? 
> 
> The behavour is called "debugging",
> if I understand your suggestion correctly.
> 
> I sugggest:
> 
> https://www.google.com/search?q=javascript+debugging+tutorial
> 
> > is there any language that
> 
> Only Javascript is on topic in this NH. 
> Debugging is a general concept much much older than Javascript.
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

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


Thread

Optional printouts using flag? jonas.thornvall@gmail.com - 2015-09-11 00:37 -0700
  Re: Optional printouts using flag? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-11 11:24 +0200
    Re: Optional printouts using flag? jonas.thornvall@gmail.com - 2015-09-11 02:55 -0700
      Re: Optional printouts using flag? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-11 12:28 +0200
        Re: Optional printouts using flag? jonas.thornvall@gmail.com - 2015-09-11 07:23 -0700
          Re: Optional printouts using flag? jonas.thornvall@gmail.com - 2015-09-11 07:27 -0700
            Re: Optional printouts using flag? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-11 16:42 +0200
              Re: Optional printouts using flag? jonas.thornvall@gmail.com - 2015-09-11 07:51 -0700
    Re: Optional printouts using flag? jonas.thornvall@gmail.com - 2015-09-11 02:58 -0700
      Re: Optional printouts using flag? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-11 12:43 +0200

csiph-web