When does a Stack Actually Die in the IDE???
What about these other options? function ObjStack2 pObj put the long id of pObj into tObj return char 2 to -2 of word -1 of tObj end ObjStack2 5.65% faster than ObjStack according to 4W RevBench (50,000 repetitions) Or function ObjStack3 pObj put the long id of pObj into tObj replace " of stack " with tab in tObj set the itemdel to tab return char 2 to -2 of item -1 of tObj end ObjStack3 1.81% faster than ObjStack according to 4W RevBench (50,000 repetitions) Richard Gaskin wrote: Sounds like an opportunity for the gang here to come up with a fast way to parse the stack name. Here's a starting point, which clocks in at 0.1349ms on a 1GHz G4: function ObjStack pObj put the long id of pObj into tObj get offset(" of stack ""e, tObj) delete char 1 to (it+10) of tObj get offset(quote,tObj) return char 1 to (it-1) of tObj end ObjStack -- Richard Gaskin Managing Editor, revJournal ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
I guess we just don't know how the engine does these things...but it's interesting to know that getting the short name from the fileName is much quicker than from the long ID. Best, Mark On 18 Apr 2006, at 17:02, David Burgun wrote: On 18 Apr 2006, at 16:29, Mark Smith wrote: I time things like this by putting them in a loop: put the millisecs into stTime repeat 1 -- for example put the short name of this stack into myStackName end repeat put the millisecs - stTime on my machine, this takes 11 millsecs. But where the engine seemed slower than string slicing, I was passing the long id of an object to a function, and in that case, parsing the ID seemed to be quicker than 'get the short name of..', by a factor of 3 or 4. Obviously, this would only matter if you were doing something many thousands of times, but you said you were concerned about it being slow... :) Yes, I am! This is called in a loop and I really want to get he maximum speed out of it I just ran the following code: constant kRepeatCount=1 on mouseUp local myStartTime local myEndTime local myStackName local myShortNameTime1 local myShortNameTime2 local myShortNameTime3 local myRepeatTime local myStackLongID local myStackFileName -- -- Calculate the time for just the repeat loop -- put the millisecs into myStartTime repeat kRepeatCount end repeat put the millisecs - myStartTime into myRepeatTime -- -- Calculate the time for getting the short name of this stack -- put the millisecs into myStartTime repeat kRepeatCount put the short name of this stack into myStackName end repeat put the millisecs - myStartTime into myShortNameTime1 put the long id of this stack into myStackLongID put the millisecs into myStartTime repeat kRepeatCount put the short name of myStackLongID into myStackName end repeat put the millisecs - myStartTime into myShortNameTime2 put the fileName of this stack into myStackFileName put the millisecs into myStartTime repeat kRepeatCount put the short name of stack myStackFileName into myStackName end repeat put the millisecs - myStartTime into myShortNameTime3 put myRepeatTime && myShortNameTime1 && myShortNameTime2 && myShortNameTime3 end mouseUp The figures I got are as follows: 1 7 58 12 so it looks like dereferencing the stack long ID is taking a really long time in comparison with getting the stack short name via the "this stack" syntax (which is what I guessed), but I was a bit stunned that doing it via the file name is way quicker than using the long id. Weird, huh? All the Best Dave ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
On 18 Apr 2006, at 16:29, Mark Smith wrote: I time things like this by putting them in a loop: put the millisecs into stTime repeat 1 -- for example put the short name of this stack into myStackName end repeat put the millisecs - stTime on my machine, this takes 11 millsecs. But where the engine seemed slower than string slicing, I was passing the long id of an object to a function, and in that case, parsing the ID seemed to be quicker than 'get the short name of..', by a factor of 3 or 4. Obviously, this would only matter if you were doing something many thousands of times, but you said you were concerned about it being slow... :) Yes, I am! This is called in a loop and I really want to get he maximum speed out of it I just ran the following code: constant kRepeatCount=1 on mouseUp local myStartTime local myEndTime local myStackName local myShortNameTime1 local myShortNameTime2 local myShortNameTime3 local myRepeatTime local myStackLongID local myStackFileName -- -- Calculate the time for just the repeat loop -- put the millisecs into myStartTime repeat kRepeatCount end repeat put the millisecs - myStartTime into myRepeatTime -- -- Calculate the time for getting the short name of this stack -- put the millisecs into myStartTime repeat kRepeatCount put the short name of this stack into myStackName end repeat put the millisecs - myStartTime into myShortNameTime1 put the long id of this stack into myStackLongID put the millisecs into myStartTime repeat kRepeatCount put the short name of myStackLongID into myStackName end repeat put the millisecs - myStartTime into myShortNameTime2 put the fileName of this stack into myStackFileName put the millisecs into myStartTime repeat kRepeatCount put the short name of stack myStackFileName into myStackName end repeat put the millisecs - myStartTime into myShortNameTime3 put myRepeatTime && myShortNameTime1 && myShortNameTime2 && myShortNameTime3 end mouseUp The figures I got are as follows: 1 7 58 12 so it looks like dereferencing the stack long ID is taking a really long time in comparison with getting the stack short name via the "this stack" syntax (which is what I guessed), but I was a bit stunned that doing it via the file name is way quicker than using the long id. Weird, huh? All the Best Dave ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
I time things like this by putting them in a loop: put the millisecs into stTime repeat 1 -- for example put the short name of this stack into myStackName end repeat put the millisecs - stTime on my machine, this takes 11 millsecs. But where the engine seemed slower than string slicing, I was passing the long id of an object to a function, and in that case, parsing the ID seemed to be quicker than 'get the short name of..', by a factor of 3 or 4. Obviously, this would only matter if you were doing something many thousands of times, but you said you were concerned about it being slow... :) Best, Mark On 18 Apr 2006, at 16:02, David Burgun wrote: Yeah! How do you time things? For instance, how long does a: put the short name of this stack into myStackName take? Since I wouldn't have thought that a: put the short name of the stack of me into myStackName wouldn't take a lot longer (if it were possible!). Since (again I assume) when you make a reference to "this stack" or "me" then the engine can quickly look up the value rather than processing a string. All the Best Dave On 18 Apr 2006, at 15:53, Mark Smith wrote: Ah, I see what you mean. I made the assumption (when will I learn?) that the file name would be a superset of the stack name. Which is a shame, where speed matters, as getting the short name from the engine is quite a bit slower than simply parsing the file name. Best, Mark On 18 Apr 2006, at 15:37, David Burgun wrote: Hi, I have a stack called s1.rev, the short name of the stack is "untitled 1". If I run this: on mouseUp local myStackName set the itemDelimiter to "/" put (char 1 to -6 of item -1 of the long id of me) into myStackName, end mouseUp and step thru it in the debugger, then myStackName is set to "s1" which is the file name, not the short name (set in the Stack Property Inspector). If I do a put openStacks in the message box, I get this list: Message Box revMenubar revScriptEditor 1 revVariableWatcher Untitled 1 revTools s1 is not among the openStacks, but "Untitled 1" is! if I run the following: local myStackFilePathName put value(word wordoffset("stack",the long id of me ) + 1 of the long id of me) into myStackFilePathName put the short name of stack myStackFilePathName into myStackName Then myStackName is set to "Untitled 1" and so it finds it ok in the list returned by openStacks. Do you get the same results? I'm running RunRev 2.6.6 MacOS 10.4.6 All the Best Dave On 18 Apr 2006, at 15:09, Mark Smith wrote: stackIsOpen2 takes the long id of an object, gets the short name of the stack the object is in, and then checks whether or not it's among the lines of the openStacks - which is a list of the short names of all currently open stacks, not their file names. It seems to work perfectly well, here ( I assume the listing below is not your actual script, there are typos ). Best, Mark On 18 Apr 2006, at 14:55, David Burgun wrote: Hi, I tried this: function stackIsOpen1 pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen2 pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen on mouseUp if stackIsOpen1(the long id of me) then beep end if if stackIsOpen2(the long id of me) then beep end if end mouseUp And both functions always return false! stackIsOpen1() since it takes the short name of the button rather than the stack and stackIsOpen2 since the short name of the stack is not the same as the file name of the stack. The only way I've found to do it is like this: -- -- -- -- ISMGetStackShortName -- -- -- function ISMGetStackShortName theObjectLongID local myStackFilePathName put value(word wordoffset("stack",theObjectLongID )+ 1 of theObjectLongID) into myStackFilePathName return the short name of stack myStackFilePathName end ISMGetStackShortName if ISMGetStackShortName(theObjectLongID) is not among the lines of openStacks then end if All the Best Dave On 18 Apr 2006, at 14:07, Mark Smith wrote: Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think..
Re: When does a Stack Actually Die in the IDE???
Hi Dave, Then myStackName is set to "Untitled 1" and so it finds it ok in the list returned by openStacks. Do you get the same results? I'm running RunRev 2.6.6 MacOS 10.4.6 That's what I would expect after reading Rev Dictionary: >> The long id of an object includes information about its owner (and about the owner of that object, and so forth). For example, suppose a stack named My Stack contains a card whose ID is 11. This card has a group whose ID is 28, which in turn contains a button whose ID is 34. The card also has a card field whose ID is 46. If "My Stack" is a main stack and its in a file whose path is /Drive/Folder/Stack.rev, the long IDs of these objects look like this: The stack: stack "/Drive/Folder/Stack.rev" << Note that it is the stack's fileName, not short name, that is returned. Rob Cozens CCW, Serendipity Software Company "And I, which was two fooles, do so grow three; Who are a little wise, the best fooles bee." from "The Triple Foole" by John Donne (1572-1631) ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Yeah! How do you time things? For instance, how long does a: put the short name of this stack into myStackName take? Since I wouldn't have thought that a: put the short name of the stack of me into myStackName wouldn't take a lot longer (if it were possible!). Since (again I assume) when you make a reference to "this stack" or "me" then the engine can quickly look up the value rather than processing a string. All the Best Dave On 18 Apr 2006, at 15:53, Mark Smith wrote: Ah, I see what you mean. I made the assumption (when will I learn?) that the file name would be a superset of the stack name. Which is a shame, where speed matters, as getting the short name from the engine is quite a bit slower than simply parsing the file name. Best, Mark On 18 Apr 2006, at 15:37, David Burgun wrote: Hi, I have a stack called s1.rev, the short name of the stack is "untitled 1". If I run this: on mouseUp local myStackName set the itemDelimiter to "/" put (char 1 to -6 of item -1 of the long id of me) into myStackName, end mouseUp and step thru it in the debugger, then myStackName is set to "s1" which is the file name, not the short name (set in the Stack Property Inspector). If I do a put openStacks in the message box, I get this list: Message Box revMenubar revScriptEditor 1 revVariableWatcher Untitled 1 revTools s1 is not among the openStacks, but "Untitled 1" is! if I run the following: local myStackFilePathName put value(word wordoffset("stack",the long id of me ) + 1 of the long id of me) into myStackFilePathName put the short name of stack myStackFilePathName into myStackName Then myStackName is set to "Untitled 1" and so it finds it ok in the list returned by openStacks. Do you get the same results? I'm running RunRev 2.6.6 MacOS 10.4.6 All the Best Dave On 18 Apr 2006, at 15:09, Mark Smith wrote: stackIsOpen2 takes the long id of an object, gets the short name of the stack the object is in, and then checks whether or not it's among the lines of the openStacks - which is a list of the short names of all currently open stacks, not their file names. It seems to work perfectly well, here ( I assume the listing below is not your actual script, there are typos ). Best, Mark On 18 Apr 2006, at 14:55, David Burgun wrote: Hi, I tried this: function stackIsOpen1 pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen2 pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen on mouseUp if stackIsOpen1(the long id of me) then beep end if if stackIsOpen2(the long id of me) then beep end if end mouseUp And both functions always return false! stackIsOpen1() since it takes the short name of the button rather than the stack and stackIsOpen2 since the short name of the stack is not the same as the file name of the stack. The only way I've found to do it is like this: --- - -- -- ISMGetStackShortName -- --- - function ISMGetStackShortName theObjectLongID local myStackFilePathName put value(word wordoffset("stack",theObjectLongID )+ 1 of theObjectLongID) into myStackFilePathName return the short name of stack myStackFilePathName end ISMGetStackShortName if ISMGetStackShortName(theObjectLongID) is not among the lines of openStacks then end if All the Best Dave On 18 Apr 2006, at 14:07, Mark Smith wrote: Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think... Best, Mark On 18 Apr 2006, at 13:28, David Burgun wrote: Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot
Re: When does a Stack Actually Die in the IDE???
Ah, I see what you mean. I made the assumption (when will I learn?) that the file name would be a superset of the stack name. Which is a shame, where speed matters, as getting the short name from the engine is quite a bit slower than simply parsing the file name. Best, Mark On 18 Apr 2006, at 15:37, David Burgun wrote: Hi, I have a stack called s1.rev, the short name of the stack is "untitled 1". If I run this: on mouseUp local myStackName set the itemDelimiter to "/" put (char 1 to -6 of item -1 of the long id of me) into myStackName, end mouseUp and step thru it in the debugger, then myStackName is set to "s1" which is the file name, not the short name (set in the Stack Property Inspector). If I do a put openStacks in the message box, I get this list: Message Box revMenubar revScriptEditor 1 revVariableWatcher Untitled 1 revTools s1 is not among the openStacks, but "Untitled 1" is! if I run the following: local myStackFilePathName put value(word wordoffset("stack",the long id of me ) + 1 of the long id of me) into myStackFilePathName put the short name of stack myStackFilePathName into myStackName Then myStackName is set to "Untitled 1" and so it finds it ok in the list returned by openStacks. Do you get the same results? I'm running RunRev 2.6.6 MacOS 10.4.6 All the Best Dave On 18 Apr 2006, at 15:09, Mark Smith wrote: stackIsOpen2 takes the long id of an object, gets the short name of the stack the object is in, and then checks whether or not it's among the lines of the openStacks - which is a list of the short names of all currently open stacks, not their file names. It seems to work perfectly well, here ( I assume the listing below is not your actual script, there are typos ). Best, Mark On 18 Apr 2006, at 14:55, David Burgun wrote: Hi, I tried this: function stackIsOpen1 pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen2 pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen on mouseUp if stackIsOpen1(the long id of me) then beep end if if stackIsOpen2(the long id of me) then beep end if end mouseUp And both functions always return false! stackIsOpen1() since it takes the short name of the button rather than the stack and stackIsOpen2 since the short name of the stack is not the same as the file name of the stack. The only way I've found to do it is like this: -- -- ISMGetStackShortName -- function ISMGetStackShortName theObjectLongID local myStackFilePathName put value(word wordoffset("stack",theObjectLongID )+ 1 of theObjectLongID) into myStackFilePathName return the short name of stack myStackFilePathName end ISMGetStackShortName if ISMGetStackShortName(theObjectLongID) is not among the lines of openStacks then end if All the Best Dave On 18 Apr 2006, at 14:07, Mark Smith wrote: Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think... Best, Mark On 18 Apr 2006, at 13:28, David Burgun wrote: Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot All the Best Dave On 18 Apr 2006, at 13:18, Mark Smith wrote: I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it mu
Re: When does a Stack Actually Die in the IDE???
Hi, I have a stack called s1.rev, the short name of the stack is "untitled 1". If I run this: on mouseUp local myStackName set the itemDelimiter to "/" put (char 1 to -6 of item -1 of the long id of me) into myStackName, end mouseUp and step thru it in the debugger, then myStackName is set to "s1" which is the file name, not the short name (set in the Stack Property Inspector). If I do a put openStacks in the message box, I get this list: Message Box revMenubar revScriptEditor 1 revVariableWatcher Untitled 1 revTools s1 is not among the openStacks, but "Untitled 1" is! if I run the following: local myStackFilePathName put value(word wordoffset("stack",the long id of me ) + 1 of the long id of me) into myStackFilePathName put the short name of stack myStackFilePathName into myStackName Then myStackName is set to "Untitled 1" and so it finds it ok in the list returned by openStacks. Do you get the same results? I'm running RunRev 2.6.6 MacOS 10.4.6 All the Best Dave On 18 Apr 2006, at 15:09, Mark Smith wrote: stackIsOpen2 takes the long id of an object, gets the short name of the stack the object is in, and then checks whether or not it's among the lines of the openStacks - which is a list of the short names of all currently open stacks, not their file names. It seems to work perfectly well, here ( I assume the listing below is not your actual script, there are typos ). Best, Mark On 18 Apr 2006, at 14:55, David Burgun wrote: Hi, I tried this: function stackIsOpen1 pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen2 pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen on mouseUp if stackIsOpen1(the long id of me) then beep end if if stackIsOpen2(the long id of me) then beep end if end mouseUp And both functions always return false! stackIsOpen1() since it takes the short name of the button rather than the stack and stackIsOpen2 since the short name of the stack is not the same as the file name of the stack. The only way I've found to do it is like this: - --- -- -- ISMGetStackShortName -- - --- function ISMGetStackShortName theObjectLongID local myStackFilePathName put value(word wordoffset("stack",theObjectLongID )+ 1 of theObjectLongID) into myStackFilePathName return the short name of stack myStackFilePathName end ISMGetStackShortName if ISMGetStackShortName(theObjectLongID) is not among the lines of openStacks then end if All the Best Dave On 18 Apr 2006, at 14:07, Mark Smith wrote: Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think... Best, Mark On 18 Apr 2006, at 13:28, David Burgun wrote: Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot All the Best Dave On 18 Apr 2006, at 13:18, Mark Smith wrote: I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me in
Re: When does a Stack Actually Die in the IDE???
stackIsOpen2 takes the long id of an object, gets the short name of the stack the object is in, and then checks whether or not it's among the lines of the openStacks - which is a list of the short names of all currently open stacks, not their file names. It seems to work perfectly well, here ( I assume the listing below is not your actual script, there are typos ). Best, Mark On 18 Apr 2006, at 14:55, David Burgun wrote: Hi, I tried this: function stackIsOpen1 pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen2 pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen on mouseUp if stackIsOpen1(the long id of me) then beep end if if stackIsOpen2(the long id of me) then beep end if end mouseUp And both functions always return false! stackIsOpen1() since it takes the short name of the button rather than the stack and stackIsOpen2 since the short name of the stack is not the same as the file name of the stack. The only way I've found to do it is like this: -- -- -- -- ISMGetStackShortName -- -- -- function ISMGetStackShortName theObjectLongID local myStackFilePathName put value(word wordoffset("stack",theObjectLongID )+ 1 of theObjectLongID) into myStackFilePathName return the short name of stack myStackFilePathName end ISMGetStackShortName if ISMGetStackShortName(theObjectLongID) is not among the lines of openStacks then end if All the Best Dave On 18 Apr 2006, at 14:07, Mark Smith wrote: Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think... Best, Mark On 18 Apr 2006, at 13:28, David Burgun wrote: Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot All the Best Dave On 18 Apr 2006, at 13:18, Mark Smith wrote: I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your name of > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the
Re: When does a Stack Actually Die in the IDE???
Hi, I tried this: function stackIsOpen1 pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen2 pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen on mouseUp if stackIsOpen1(the long id of me) then beep end if if stackIsOpen2(the long id of me) then beep end if end mouseUp And both functions always return false! stackIsOpen1() since it takes the short name of the button rather than the stack and stackIsOpen2 since the short name of the stack is not the same as the file name of the stack. The only way I've found to do it is like this: -- -- ISMGetStackShortName -- function ISMGetStackShortName theObjectLongID local myStackFilePathName put value(word wordoffset("stack",theObjectLongID )+ 1 of theObjectLongID) into myStackFilePathName return the short name of stack myStackFilePathName end ISMGetStackShortName if ISMGetStackShortName(theObjectLongID) is not among the lines of openStacks then end if All the Best Dave On 18 Apr 2006, at 14:07, Mark Smith wrote: Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think... Best, Mark On 18 Apr 2006, at 13:28, David Burgun wrote: Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot All the Best Dave On 18 Apr 2006, at 13:18, Mark Smith wrote: I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your name of > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http:// www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___
Re: When does a Stack Actually Die in the IDE???
Well, since function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen was, by my measurement, 4 times slower than function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStack end stackIsOpen I wouldn't assume that the engines routines for getting short names etc, are going to be faster than string slicing. I've no idea what kind of overhead there is in calling externals, and it'd have to be a pretty good external to beat Rev's string handling, I think... Best, Mark On 18 Apr 2006, at 13:28, David Burgun wrote: Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot All the Best Dave On 18 Apr 2006, at 13:18, Mark Smith wrote: I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your name of > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com P
Re: When does a Stack Actually Die in the IDE???
Hi, I was really just after some speed. The problem is that this quite a common thing to want to do, you can do it, but it means parsing a string, which although the solution provided by the wonderful people on this list is pretty fast, it's still slow for doing something like this, which seems pretty silly really since I assume that this information would be almost instantly available in the Engine. I was actually considering writing an External Command to do this, but not sure how fast that would be and whether the solutions provided thus far would be quicker. Any ideas??? Thanks a lot All the Best Dave On 18 Apr 2006, at 13:18, Mark Smith wrote: I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
I see what you mean. Maybe what's needed is a library of functions to deal with this sort of thing. Mark On 18 Apr 2006, at 10:34, David Burgun wrote: Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Hi, The problem with that is if you have groups or nested groups, you then have to loop thru until you find the card or stack. All the Best Dave On 15 Apr 2006, at 13:07, Mark Smith wrote: Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
When does a Stack Actually Die in the IDE???
What about these other options? function ObjStack2 pObj put the long id of pObj into tObj return char 2 to -2 of word -1 of tObj end ObjStack2 5.65% faster than ObjStack according to 4W RevBench (50,000 repetitions) Or function ObjStack3 pObj put the long id of pObj into tObj replace " of stack " with tab in tObj set the itemdel to tab return char 2 to -2 of item -1 of tObj end ObjStack3 1.81% faster than ObjStack according to 4W RevBench (50,000 repetitions) Richard Gaskin wrote: Sounds like an opportunity for the gang here to come up with a fast way to parse the stack name. Here's a starting point, which clocks in at 0.1349ms on a 1GHz G4: function ObjStack pObj put the long id of pObj into tObj get offset(" of stack ""e, tObj) delete char 1 to (it+10) of tObj get offset(quote,tObj) return char 1 to (it-1) of tObj end ObjStack -- Richard Gaskin Managing Editor, revJournal Marielle Lange (PhD), Freelance Academic Widged http://widged.com/ Easy access to lexical databaseshttp:// lexicall.widged.com/ Supporting Education Technologists http:// revolution.widged.com/wiki/ ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Well, you could try using 'the owner of'. I haven't experimented with it much, so I don't know how flexible it is. Best, Mark On 15 Apr 2006, at 12:54, David Burgun wrote: Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Hi, Thanks a lot for this. One thing that has puzzled me is why you can't access things like the stack or card of an object. For instance why can't I just do this: put the short name of the stack of the long id of me into myStackName or put the short name of the card of the long id of me myCardName Which would return the name of the stack/card that the object resides in. It just seems like this ought to work, in fact when I found out that RunRev didn't support this I was surprised! Any ideas why this isn't supported? All the Best Dave On 15 Apr 2006, at 02:33, J. Landman Gay wrote: Mark Smith wrote: > I just had a doh! moment in response to your > pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Mark Smith wrote: > I just had a doh! moment in response to your pStackLongID>, but then in order to see how much faster the engine does > this, I tested it the same way I tested my first tries (which was > actually with 1 iterations, not 1000), and > > function stackIsOpen pLongID > return (the short name of pLongID is among the lines of the openstacks) > end stackIsOpen > > takes nearly 600 ms! Interesting. I never time these things enough. It looks like if a script needs to make repeated calls to the function, then your way would be preferable because of the speed increase. It's been an interesting experiment, I like when the list does these things. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
I just had a doh! moment in response to your pStackLongID>, but then in order to see how much faster the engine does this, I tested it the same way I tested my first tries (which was actually with 1 iterations, not 1000), and function stackIsOpen pLongID return (the short name of pLongID is among the lines of the openstacks) end stackIsOpen takes nearly 600 ms! And you're right, of course, the original question was as you described. I didn't read it carefully enough. Though, as far as I can see, the original stackIsOpen function will work ok for the long id of any control of a main stack, provided the stack has a file name. Best, Mark On 14 Apr 2006, at 21:54, J. Landman Gay wrote: J. Landman Gay wrote: Mark Smith wrote: The best I could do was: function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStacks end stackIsOpen which on a 1.5mhz G4 powerbook took 150 ms for 1000 iterations. (checking the windowID took 500 ms). The trouble with 'value(word wordoffset("stack",pLongID)+1 of pLongID)' is that given the long id of a stack, it returns the full path of the stack, so is never in the openStacks. True. The original request was for a way to identify the stack that held the long ID of an object in the stack, so that's what my script did. But you're right, it wouldn't work with file paths. For long IDs that are stack file paths, you can use: get (the short name of pStackLongID is in the openstacks) Oh, and re-reading this, I think your method is better regarding "among the lines of" -- it prevents one of those forward-looking potential bugs we've been talking about on the list recently. So I revise myself: get (the short name of pStackLongID is among the lines of the openstacks) -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
J. Landman Gay wrote: Mark Smith wrote: The best I could do was: function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStacks end stackIsOpen which on a 1.5mhz G4 powerbook took 150 ms for 1000 iterations. (checking the windowID took 500 ms). The trouble with 'value(word wordoffset("stack",pLongID)+1 of pLongID)' is that given the long id of a stack, it returns the full path of the stack, so is never in the openStacks. True. The original request was for a way to identify the stack that held the long ID of an object in the stack, so that's what my script did. But you're right, it wouldn't work with file paths. For long IDs that are stack file paths, you can use: get (the short name of pStackLongID is in the openstacks) Oh, and re-reading this, I think your method is better regarding "among the lines of" -- it prevents one of those forward-looking potential bugs we've been talking about on the list recently. So I revise myself: get (the short name of pStackLongID is among the lines of the openstacks) -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Mark Smith wrote: The best I could do was: function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStacks end stackIsOpen which on a 1.5mhz G4 powerbook took 150 ms for 1000 iterations. (checking the windowID took 500 ms). The trouble with 'value(word wordoffset("stack",pLongID)+1 of pLongID)' is that given the long id of a stack, it returns the full path of the stack, so is never in the openStacks. True. The original request was for a way to identify the stack that held the long ID of an object in the stack, so that's what my script did. But you're right, it wouldn't work with file paths. For long IDs that are stack file paths, you can use: get (the short name of pStackLongID is in the openstacks) -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
The best I could do was: function stackIsOpen pLongID set the itemDelimiter to "/" return (char 1 to -6 of item -1 of pLongID) is among the lines of the openStacks end stackIsOpen which on a 1.5mhz G4 powerbook took 150 ms for 1000 iterations. (checking the windowID took 500 ms). The trouble with 'value(word wordoffset("stack",pLongID)+1 of pLongID)' is that given the long id of a stack, it returns the full path of the stack, so is never in the openStacks. Best, Mark On 14 Apr 2006, at 18:08, Richard Gaskin wrote: J. Landman Gay wrote: Richard Gaskin wrote: Sounds like an opportunity for the gang here to come up with a fast way to parse the stack name. function objStack pLongID return value(word wordoffset("stack",pLongID)+1 of pLongID) end objStack Didn't time it. One-liner though. :) Well done: 0.027ms (1GHz G4) I'd considered the value function, but sometimes I get skittish about it for fear of object names that may evaluate to valid expressions. But apparently since the name is in quotes it doesn't matter -- I even named my stack "time()" and it still only returned the first- level evaluation (removing the quotes to obtain the string "time()"). Good job, Jacque. -- Richard Gaskin Managing Editor, revJournal ___ Rev tips, tutorials and more: http://www.revJournal.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
This isn't extensively tested, but if you have the long ID of a stack in a variable tLongID, then the windowID of tLongID = 0 should be true if the stack is not open so you could have a function function stackIsOpen tLongID if the windowID of tLongID < > 0 then return true else return false end if end stackIsOpen Best, Mark On 14 Apr 2006, at 13:19, David Burgun wrote: Hi, The problem is that I only have the long id of an object, to get the stack name from this I have to parse the long id as a string, which I can do, but it's slow. Any Ideas? All the Best Dave On 14 Apr 2006, at 13:10, Chipp Walters wrote: Hi David, Close and Delete from memory should do the trick. Instead of exists (), try checking the openStacks function. I believe the engine keeps track of all stacks it has opened in a given session, regardless and that's why it appears in exists(). I use this feature to 'relaunch' a splashscreen stack from a mainstack if i need to. best, Chipp ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
J. Landman Gay wrote: Richard Gaskin wrote: Sounds like an opportunity for the gang here to come up with a fast way to parse the stack name. function objStack pLongID return value(word wordoffset("stack",pLongID)+1 of pLongID) end objStack Didn't time it. One-liner though. :) Well done: 0.027ms (1GHz G4) I'd considered the value function, but sometimes I get skittish about it for fear of object names that may evaluate to valid expressions. But apparently since the name is in quotes it doesn't matter -- I even named my stack "time()" and it still only returned the first-level evaluation (removing the quotes to obtain the string "time()"). Good job, Jacque. -- Richard Gaskin Managing Editor, revJournal ___ Rev tips, tutorials and more: http://www.revJournal.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
David Burgun wrote: Hi, I have a stack that has: destroyStack, destroyWindow set to true. However, when I close it in the IDE (and maybe the standalone, haven't tried it?) it seems to still be around, by this I mean that: if exists(theObjectLongID) = true then end if Succeeds and you can call objects inside that stack. I then closed it with "Close and Remove from Memory" command, but the exists() function still returns true. Is this normal behavior? If so, is there a way if I can tell if an Object is in a closed stack? Using a script fragment I just posted in another note: get (value(word wordoffset("stack",pLongID)+1 of pLongID)) \ is in the openstacks This should tell you if the stack is open or not. -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Richard Gaskin wrote: Sounds like an opportunity for the gang here to come up with a fast way to parse the stack name. function objStack pLongID return value(word wordoffset("stack",pLongID)+1 of pLongID) end objStack Didn't time it. One-liner though. :) -- Jacqueline Landman Gay | [EMAIL PROTECTED] HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Does this work for you? set the itemDel to "/" get char 1 to -2 of item -1 of the long name of this stack answer it Jim Ault Las Vegas On 4/14/06 8:08 AM, "Richard Gaskin" <[EMAIL PROTECTED]> wrote: > David Burgun wrote: >> The problem is that I only have the long id of an object, to get the >> stack name from this I have to parse the long id as a string, which I >> can do, but it's slow. > > Sounds like an opportunity for the gang here to come up with a fast way > to parse the stack name. > > Here's a starting point, which clocks in at 0.1349ms on a 1GHz G4: > > function ObjStack pObj >put the long id of pObj into tObj >get offset(" of stack ""e, tObj) >delete char 1 to (it+10) of tObj >get offset(quote,tObj) >return char 1 to (it-1) of tObj > end ObjStack > > > -- > Richard Gaskin > Managing Editor, revJournal > ___ > Rev tips, tutorials and more: http://www.revJournal.com > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
David Burgun wrote: The problem is that I only have the long id of an object, to get the stack name from this I have to parse the long id as a string, which I can do, but it's slow. Sounds like an opportunity for the gang here to come up with a fast way to parse the stack name. Here's a starting point, which clocks in at 0.1349ms on a 1GHz G4: function ObjStack pObj put the long id of pObj into tObj get offset(" of stack ""e, tObj) delete char 1 to (it+10) of tObj get offset(quote,tObj) return char 1 to (it-1) of tObj end ObjStack -- Richard Gaskin Managing Editor, revJournal ___ Rev tips, tutorials and more: http://www.revJournal.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Hi, The problem is that I only have the long id of an object, to get the stack name from this I have to parse the long id as a string, which I can do, but it's slow. Any Ideas? All the Best Dave On 14 Apr 2006, at 13:10, Chipp Walters wrote: Hi David, Close and Delete from memory should do the trick. Instead of exists (), try checking the openStacks function. I believe the engine keeps track of all stacks it has opened in a given session, regardless and that's why it appears in exists(). I use this feature to 'relaunch' a splashscreen stack from a mainstack if i need to. best, Chipp ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Hi David, Hi, I have a stack that has: destroyStack, destroyWindow set to true. However, when I close it in the IDE (and maybe the standalone, haven't tried it?) it seems to still be around, by this I mean that: if exists(theObjectLongID) = true then end if Succeeds and you can call objects inside that stack. I then closed it with "Close and Remove from Memory" command, but the exists() function still returns true. the long id of stack xyz is a file reference actually! -> stack "/Users/klaus/Desktop/test.rev" Is this normal behavior? Yep :-) If so, is there a way if I can tell if an Object is in a closed stack? Closed mainstack: put there is a btn "bbb" of cd 1 of stack "/Users/klaus/Desktop/fnn.rev" -> true Or in a substack of the closed mainstack: put there is a btn "bbbsub1" of cd 1of stack "sub1" of stack "/Users/ klaus/Desktop/fnn.rev" -> true Thanks a lot All the Best Dave Regards Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: When does a Stack Actually Die in the IDE???
Hi David, Close and Delete from memory should do the trick. Instead of exists(), try checking the openStacks function. I believe the engine keeps track of all stacks it has opened in a given session, regardless and that's why it appears in exists(). I use this feature to 'relaunch' a splashscreen stack from a mainstack if i need to. best, Chipp ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
When does a Stack Actually Die in the IDE???
Hi, I have a stack that has: destroyStack, destroyWindow set to true. However, when I close it in the IDE (and maybe the standalone, haven't tried it?) it seems to still be around, by this I mean that: if exists(theObjectLongID) = true then end if Succeeds and you can call objects inside that stack. I then closed it with "Close and Remove from Memory" command, but the exists() function still returns true. Is this normal behavior? If so, is there a way if I can tell if an Object is in a closed stack? Thanks a lot All the Best Dave ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution