Trapping for Cancel Answer printer

Ken Ray kray at sonsothunder.com
Sun Nov 30 18:37:55 EST 2003


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: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> katir at hindu.org
> Sent: Sunday, November 30, 2003 1:47 PM
> To: use-revolution at lists.runrev.com
> 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
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-> revolution
> 




More information about the use-livecode mailing list