Katir, You need to look at "the result", not "it". Put this in the message box and you'll see:
answer printer;put the result If you click the Cancel button you get "Cancel", if you click the OK button you get "". HTH, Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Sunday, November 30, 2003 1:47 PM > To: [EMAIL PROTECTED] > Subject: Trapping for Cancel Answer printer > > > > Jeanne, this either needs fixed or needs documented. > > Today on OSX Panther, Rev is not getting "Cancel" back to the > local variable "it" from the print dialog box. "it" is > empty. This is probably correct as the default engine > behavior, but its not in the docs. > > set the printmargins to 0,0,0,0 > answer printer > if it is "Cancel" then > set the rect of this stack to gStackSize > exit printThisSloka > else > print card > end if > set the rect of this stack to gStackSize > restorePresentationPositions > > In the print dialog box, the button is clearly "Cancel" but > if I cancel, the script doesn't stop, the card is printed. > On the other hand "the result" does work: > > set the printmargins to 0,0,0,0 > if the result is "Cancel" then > set the rect of this stack to gStackSize > exit printThisSloka > else > print card > end if > > This is either a bug, where for use of "answer printer" Rev > should pass the result to "it" or needs more documentation if > the globally expected engine behavior is for anything from > the system to *not* be in "it" but be passed via the result, > which is also logical. Old time xTalkers may take that for > granted, newbies will stumble =====docs could say something like: > > " data returned from system functions and system dialogs > may not always be passed to the local variable "it". in > such cases, the system response is probably in "the result." > For example, if a user cancels a print job from the system > Page Set up or Print Dialog, the local variable "it" will be > empty, but, "the result" will be "Cancel," if the button > pushed was "Cancel." > > > > _______________________________________________ > use-revolution mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/use-> revolution > _______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
