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


Groups > comp.lang.javascript > #28676

Re: Optional printouts using flag?

Newsgroups comp.lang.javascript
Subject Re: Optional printouts using flag?
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <c3ba3a04-f3c6-46e9-9689-0ded66ec999e@googlegroups.com>
Date 2015-09-11 11:24 +0200
Message-ID <XnsA51274157CFBBeejj99@194.109.6.166> (permalink)

Show all headers | View raw


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?

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

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"? 

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, 

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