Re: XY
on 01.25.02 02:16PM, Richard Gaskin wrote: > > As normally written in HyperCard (as the first example showed), the xy > handler is invoked, runs while it's needed, and stops soon after when the > mouse is clicked. Yes, it was eating far more clock cycles than needed > while it was running, but using it is inherently modal by nature anyway -- > the only thing the user's doing is moving the mouse; as soon as they click > it's over. I agree that the XY handler is a good example of a legitimate use of polling, though I prefer the mousemove plus frontscripts implementation overall to avoid 'waste of clock cycles'. I would recommend, however, that most places where one is tempted to use a repeat "while the mouse is..." would work quite reliably with mouseMove. Scott finally convinced me of this after I tried my mightiest to create a group of objects that would work better in concert without mouseMove, and every time the mousemove solution was cleaner, faster, and much more reliable. It does mean watching where you put your handler (i.e. NOT where it would be executed all the time ;-). tereza + Tereza Snyder + Senior Software Developer + Attainment Company, Inc. + + 800.327.4269 ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: mc cgi darwin
andu wrote: > > Richard MacLemale wrote: > > > > I wrote, then Andu wrote, > > >> on startup > > >>put "Hello" > > >>put shell("ls -l") > > >> end startup > > >> > > >> When I run it from the command line (./test.mt), I get this: > > >> > > >> Hello > > >> > > >> I can run other metacard scripts and everything else works perfectly. > > >> > > >> Sooo What am I doing wrong? > > > > > > Nothing. It just doesn't work. It works on Linux though so it must be a > > > Darwin thing. > > > > OK - Scott Raney said you could do shell commands in darwin mc, and someone > > else verified that you could, but the above script doesn't work, s... > > What would be an example of a script that WOULD work? > > I can do shell() in a stack (GUI) but not in a cgi or a stack called by > a cgi with "start using". Why, I don't know maybe Scott can tell us what > we do wrong. > > > > > Please? > > > > :) > > Richard MacLemale > > Instructional Technology Specialist > > James W. Mitchell High School > > http://mitchellonline.pasco.k12.fl.us > > > > ___ > > metacard mailing list > > [EMAIL PROTECTED] > > http://lists.runrev.com/mailman/listinfo/metacard > > -- > __ > Regards, Andu > ___ > metacard mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/metacard Hi Andu, Do you have set the right permissions (file and directory) as needed before lauching the .mt cgi-script ? Best Regards, Pierre Sahores WEB & VPN applications & databases servers Inspection académique de Seine-Saint-Denis Qualifier & produire l'avantage compétitif ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: XY
Tereza Snyder wrote: >>> Scott Raney has told us in the past that "repeat until the mouseClick" is >>> not a good idea because it bolixes up the event handling in the engine. I've >>> found that mouseMove works wonderfully in situations where you'd be tempted >>> to use "repeat until the mouse is up" or similar loops. >> >> While mousemove seems straight forward, how would one go about turning it on >> and off as might be needed in the "XY function"? >> > > something like: (NOT A REAL SCRIPT) > > LOCAL tXY = false > > on XY > put true into tXY > end XY > > on mouseMove mX,mY > if tXY then > if the mouse is down then > put false into tXY > else > -- do XY stuff > end if > end mouseMove > > another way: on XY, insert a script containing the code temporarily into the > front, and remove it on mouseup The latter is probably a good idea, even if it does seem unnecessarily complicated at first glance. But this lil' ditty opens up a debate about polling events vs. notification events. Scott is quick to remind us, and rightfully so 99.% of the time, that messages that rely on polling (MC's event loop making repeating queries of the OS) as opposed to notification (when the OS sends MC a message) are a performance drain on the machine, esp. noticeable in environments with true multitasking like OS X (as opposed to OS 9 and earlier). While this is merely factual and cannot be argued, it can be argued that there are times when it's perfectly acceptable, if not beneficial, to rely o polling. The XY handler is a good example: As normally written in HyperCard (as the first example showed), the xy handler is invoked, runs while it's needed, and stops soon after when the mouse is clicked. Yes, it was eating far more clock cycles than needed while it was running, but using it is inherently modal by nature anyway -- the only thing the user's doing is moving the mouse; as soon as they click it's over. In contrast, the addition of a mouseMove handler to provide the same effect requires that the interpreter evaluate a variable flag everytime the mouse is moved -- potentially several dozen times every second -- whether XY is in use or not. In an average work week you may be running XY only a few times, but that flag will be evaluated every time the mouse moves, all day, every day. I would imagine the aggregate waste of clock cycles, however difficult to notice, would be far greater by the end of the week using "mouseMove" over "repeat until the mouseClick", no? -- Richard Gaskin Fourth World Media Corporation Custom Software and Web Development for All Major Platforms Developer of WebMerge 1.9: Publish your database on the Web ___ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 AIM: FourthWorldInc ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: XY
on 01.25.02 01:19PM, Nelson Zink wrote: > Tereza, > >> To avoid bottling up the engine servicing your loop: >> >> on mouseMove mX, mY >> put format( "horz: %d vert: %d", mX, mY ) >> end mouseMove >> >> Scott Raney has told us in the past that "repeat until the mouseClick" is >> not a good idea because it bolixes up the event handling in the engine. I've >> found that mouseMove works wonderfully in situations where you'd be tempted >> to use "repeat until the mouse is up" or similar loops. > > While mousemove seems straight forward, how would one go about turning it on > and off as might be needed in the "XY function"? > something like: (NOT A REAL SCRIPT) LOCAL tXY = false on XY put true into tXY end XY on mouseMove mX,mY if tXY then if the mouse is down then put false into tXY else -- do XY stuff end if end mouseMove another way: on XY, insert a script containing the code temporarily into the front, and remove it on mouseup + Tereza Snyder + Senior Software Developer + Attainment Company, Inc. + + 800.327.4269 ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: XY
On Friday, January 25, 2002, at 11:19 AM, Nelson Zink wrote: > While mousemove seems straight forward, how would one go about turning > it on > and off as might be needed in the "XY function"? One way is with a variable toggle, via a global variable or a user property. For example, in a button script that toggles the XY function on and off: set the uAllowXY of this stack to not the uAllowXY of this stack In the card or stack script: on mouseMove x,y if not the uAllowXY of this stack then exit mouseMove # XY function here... end mouseMove Regards, Scott Rossi Creative Director, Tactile Media [EMAIL PROTECTED] http://www.tactilemedia.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: darwin mc
On Thu, 24 Jan 2002 andu <[EMAIL PROTECTED]> wrote: > > >> I know that MetaCardCarbon does not honor shell (as in put shell("ls *") > > >> into field 1)... Am I correct in assuming that the darwin mc engine is also > > >> unable to do shell commands? I tried and it didn't work but wanted to > > >> verify it here. > > > > > > Works fine here... > > > > OK, can someone provide a really simple example of a .mt script that > > includes a shell command? I created a text file (with UNIX line breaks) > > called "test.mt" with the following script: > > > > on startup > >put "Hello" > >put shell("ls -l") > > end startup > > > > When I run it from the command line (./test.mt), I get this: > > > > Hello > > > > I can run other metacard scripts and everything else works perfectly. > > > > Sooo What am I doing wrong? > > Nothing. It just doesn't work. It works on Linux though so it must be a > Darwin thing. No really, that exact script runs fine here. Maybe a version thing? Are you running 10.1.2? Maybe a permissions problem? Are you running this from a terminal window in a directory you own? In any case, we should take this off list... Regards, Scott > > :) > > Richard MacLemale > > Instructional Technology Specialist > > James W. Mitchell High School > > http://mitchellonline.pasco.k12.fl.us > > -- > __ > Regards, Andu Scott Raney [EMAIL PROTECTED] http://www.metacard.com MetaCard: You know, there's an easier way to do that... ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: XY
Tereza, > To avoid bottling up the engine servicing your loop: > > on mouseMove mX, mY > put format( "horz: %d vert: %d", mX, mY ) > end mouseMove > > Scott Raney has told us in the past that "repeat until the mouseClick" is > not a good idea because it bolixes up the event handling in the engine. I've > found that mouseMove works wonderfully in situations where you'd be tempted > to use "repeat until the mouse is up" or similar loops. While mousemove seems straight forward, how would one go about turning it on and off as might be needed in the "XY function"? Nelson ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Launching a URL in OSX is Cake?
Scott Rossi wrote: > > Recently, Geoff Canyon wrote: > > >> I like using the ascii for "delete" as a placeholder, because it works > >> fine and there's no way a user has typed it. > > > You know, that's a good point about not being able to type "delete". > > "formFeed" is another useful option. Good idea, I hadn't thought of that one. Another one I use often is numToChar(3), which is the Enter key. Users can't type that one either. There's also the "bell" but I can't remember what its ascii number is. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: mc cgi darwin
Richard MacLemale wrote: > > I wrote, then Andu wrote, > >> on startup > >>put "Hello" > >>put shell("ls -l") > >> end startup > >> > >> When I run it from the command line (./test.mt), I get this: > >> > >> Hello > >> > >> I can run other metacard scripts and everything else works perfectly. > >> > >> Sooo What am I doing wrong? > > > > Nothing. It just doesn't work. It works on Linux though so it must be a > > Darwin thing. > > OK - Scott Raney said you could do shell commands in darwin mc, and someone > else verified that you could, but the above script doesn't work, s... > What would be an example of a script that WOULD work? I can do shell() in a stack (GUI) but not in a cgi or a stack called by a cgi with "start using". Why, I don't know maybe Scott can tell us what we do wrong. > > Please? > > :) > Richard MacLemale > Instructional Technology Specialist > James W. Mitchell High School > http://mitchellonline.pasco.k12.fl.us > > ___ > metacard mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/metacard -- __ Regards, Andu ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: metacard digest, Vol 1 #78 - 14 msgs
I wrote, then Andu wrote, >> on startup >>put "Hello" >>put shell("ls -l") >> end startup >> >> When I run it from the command line (./test.mt), I get this: >> >> Hello >> >> I can run other metacard scripts and everything else works perfectly. >> >> Sooo What am I doing wrong? > > Nothing. It just doesn't work. It works on Linux though so it must be a > Darwin thing. OK - Scott Raney said you could do shell commands in darwin mc, and someone else verified that you could, but the above script doesn't work, s... What would be an example of a script that WOULD work? Please? :) Richard MacLemale Instructional Technology Specialist James W. Mitchell High School http://mitchellonline.pasco.k12.fl.us ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Launching a URL in OSX is Cake?
on 25/1/02 7:11 AM, Scott Rossi at [EMAIL PROTECTED] wrote: >>> I like using the ascii for "delete" as a placeholder, because it works >>> fine and there's no way a user has typed it. > >> You know, that's a good point about not being able to type "delete". > > "formFeed" is another useful option. But watch out a bit, because the fact that a user can't type it doesn't mean it can't - at least in principle - be a character in a legitimate and genuine path. This isn't completely hairsplitting; all my file info xfcns return line format lists (ie ascii CR, 13, is the delimiter). My many useful old file manipulation stacks which recurse over folders now choke on the files that Apple introduced to hold custom icons for folders, named - so to speak - "icon%0D" (ie the file name ends with a return character - so my lists of files include two names of non-existent files, "icon" and ). Ben Rubinstein | Email: [EMAIL PROTECTED] Cognitive Applications Ltd | Phone: +44 (0)1273-821600 http://www.cogapp.com| Fax : +44 (0)1273-728866 ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard