Berkeley CSUA MOTD:Entry 21270
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2001/5/14-15 [Reference/History, Computer/SW/Languages/JavaScript] UID:21270 Activity:high
5/14    In Acrobat 5.0 Javascript, how do you break out of an if statement in
        a particular mouse action? 'break' does not seem to work. Thx - jthoms
        \_ can't you restructure it so you don't need to do this? like a while
           loop around it or nested ifs?
           \_ Let me rephrase the question. Suppose I have a button-pressed
              event that has the following code in it:
                if (some_field < 0) {
                   app.alert ("Please enter some_field that is >= 0");
                   <break>;
                }

                if (some_field2 < 0) {
                        ...
                }

                What should <break> be? In VB, you can simply do an 'Exit Sub'.
                \_ if it's in a function or method or whatever, can you just use
                   a return?
                  \_ No, that's the thing, it's not really a function. It's an
                     event. I did try 'return' and it says 'return undefined'.
                     \_ I'm not familiar with Javascript in Acrobat, but how
                        about something like:
                           do
                           {  ...
                              if (...) { break; }
                              ...
                           } while (false);
                        Also, how about putting all your event code in a real
                        function instead?  have the event call the function,
                        where you should then be able to use "return".
                        where "return" should be valid.
                  \_ does your stupid language not provide an else construct?
                     if(cond1) { .. }
                     else if(cond2) { ... }
                     else if(cond3) { ... }
                  \_ First of all it's not MY stupid language. Second of all,
                     you're missing the point... I have no problem breaking out
                     of an if statement; the problem is to break out of the
                     entire event. Thx.
                     \_ it would be easier if we better understood your problem.
                        what do you mean break out of an event?  how is that
                        different from, say, having Foo() called in response to
                        eventX, and then having Foo() return prematurely under
                        your specified conditions?  is there some other event
                        handling code that will be run afterward that you want
                        to avoid?  are you trying to prevent subsequent events
                        from being generated (like preventing a mouseup after
                        a mousedown)?
                        postprocessing you're trying to avoid?  are you trying
                        to prevent subsequent events from being generated (like
                        preventing a mouseup after a mousedown)?
2025/05/25 [General] UID:1000 Activity:popular
5/25    

You may also be interested in these entries...
2009/11/21-30 [Reference/History, Science] UID:53537 Activity:nil
11/21   http://abstrusegoose.com/strips/a_wise_man_once_said.PNG
        What scientific event does the first frame "Do not disturb my circles"
        refer to?  Thx.
        \- not really a scientific event. story about Archimedes's last
           words before being mistakenly [contrary to orders] killed by
           a roman soldier after the occupation of syracuse. note: this
	...
2009/4/10-20 [Reference/Law/Court] UID:52838 Activity:low
4/10    Is it common for a judge in a family court situation to tell
        the attorneys or both sides how he wants to see the situation
        resolved, and inform them that if the parties don't agree to that
        resolution in open court that it will not go well for party
        not toeing his perffered line?  This seems a little strange
        to me. It also leaves no record of the outside influence for
	...
2010/8/8-9/7 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Web] UID:53914 Activity:nil
8/8     Trying to make a list of interesting features languages have
        touted as this whole PL field comes around, trying to see if they
        have basis in the culture of the time: feel free to add some/dispute
        1970 C, "portability"
        1980 C++, classes, oop, iterators, streams, functors, templates
             expert systems
	...
2009/9/28-10/8 [Computer/SW/Languages/C_Cplusplus] UID:53409 Activity:nil
9/28    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
        Java is #1!!! Followed by C, PHP, C++, Visual Basic, Perl,
        C#, Python, Javascript, then finally Ruby. The good news is
        Pascal is going waaaay back up!
        \_ C is still more popular than C++?  I feel much better about myself
           now.
	...
2009/8/3-11 [Computer/SW/Languages/Web] UID:53231 Activity:moderate
8/1     Where's the place people go for free webspace these days?  Helping
        my sis's  kid learn how to set up html/php/some minor javascript.
        \_ not geocities:
           http://help.yahoo.com/l/us/yahoo/geocities/close/close-07.html
        \_ why are there 2987394872 places offering free blog space but
           not alot offering free webspace like before.
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2009/6/30-7/15 [Computer/SW/Languages/JavaScript] UID:53098 Activity:nil
6/30    Javascript, I love you:
        var b = new Boolean(false);
        b;        // false
        !b;       // ALSO false
        !b == b;  // But this is true!
        !!b == !b // Negate both sides and it's false again. FUCK.
	...
2008/9/22-24 [Science/Electric, Computer/Companies/Google, Computer/SW/Editors/Vi] UID:51263 Activity:kinda low
9/22    Gmail's "conversation feature" drives me nuts! Is there a way to
        disable that and make Gmail act like every other e-mail client on the
        planet? WTF thought this was a nice thing to have on by default?
        \_ Umm, why don't you just use another email service then...
           \_ Umm, I do, which is how I have something to compare to. I get
              mail in at least 4 places only one of which is Gmail. I
	...
2008/6/17-20 [Computer/SW/WWW/Browsers] UID:50275 Activity:kinda low 57%like:50273
6/16    Firefox 3 coming out tomorrow.
        http://news.yahoo.com/s/nf/20080612/bs_nf/60269
        Memory usage - Firefox 3 Beta vs. Firefox 2 vs. IE 7:
        http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage
        \_ There's a rule that says NEVER BE THE FIRST TO TRY IT.
           I'm going to let Firefox3 version 1 hammer out bugs first.
	...
2008/3/4-7 [Computer/SW/Virus] UID:49325 Activity:kinda low
3/4     Hi, what's the best free anti-virus software for XP?  What about
        anti-spyware?  Currently I'm using Active Virus Shield and Spybot.
        Thanks.
        \_ I've used: avg, spybot s&d, adaware, trend micro's housecall.
           \_ Does Spybot S&D protect Firefox?  It soulds like the injection
              feature only supports IE.
	...
2008/3/5-7 [Computer/Companies/Google] UID:49346 Activity:kinda low
3/5     How does Google Map widget work? Is it a flash program or a
        pure Javascript program? When you include a Google Map on your
        home page, how does it talk to the <DEAD>maps.google.com<DEAD> server?
        I thought cross domain is not possible.
        \_ Pure JavaScript.  It uses an <iframe> to avoid cross-domain issues.
           \_ You mean the thing that scrolls/moves around is an
	...
2008/2/7-11 [Computer/SW/Languages] UID:49084 Activity:low
2/7     Hi I'd like to learn Flash. I have no UI experience but I just want to
        learn for the sake for curiosity. I just want to create something that
        is interactive and fun, and don't care about scalability/extensibility/
        reliability/efficiency/blah-blah. What language is Flash most similar
        to and how easy/difficult is it to get started (e.g. "hello world")?
        -kchang
	...