Subj : a small javascript... To : Access Denied From : Digital Man Date : Wed Apr 13 2011 08:55 am Re: a small javascript... By: Access Denied to Digital Man on Tue Apr 12 2011 08:58 pm > Re: a small javascript... > By: Digital Man to Internetking on Mon Apr 11 2011 04:22 pm > > > Here's an example (untested): > > > console.printfile("c:/slbbs/text/bbsrules.txt"); > > if(console.noyes("Do you agree to the BBS rules")) > > bbs.hangup(); > > Just chiming in on this one trying to understand some simple javascript. So > if you use console.noyes and have bbs.hangup(); right after it, the no is > highlighted (as it being noyes rather than yesno) so that only happens if > no is used? And it would work vice versa? Now if yes is selected, it > automatically bypasses the bbs.hangup(); ? I'm just asking because I have > very little coding intelligence, and whatever I did have back in the 90s > had a lot to do with if/then or else statements in order to do what seems > so easy in two lines with javascript. :) Yes, the if() is checking if the code inside the () evaluates to true or not. In the case of console.noyes(), it returns true when the user selects "no". The nested expression(s), in this case, bbs.hangup() is only executed if the if() test evaluates to true. digital man Synchronet "Real Fact" #19: Michael Swindell was directly responsible for Synchronet's commercial success. .