Rev Crash Again!

Jim Carwardine JimCarwardine at OwnYourFuture-net.com
Wed Jan 7 13:07:53 EST 2004


I hope I can get someone to respond to this.  I¹m at my wit¹s end... Jim

Hi Folks... I¹m scripting a button to create a thumbnail button icon of the
current card.  When I run the following button script, it runs fine the
first time.  If I run it a second time, Rev aborts on the statement I have
marked.  How come?  Am I overflowing a buffer or something?  It¹s hampering
my testing by restarting Rev, however when I do, it runs fine then aborts
the second time again.

on ExportCard pStackPath,pImageType
  -- pStackPath is the path to the stack whose card you want to export
  -- pImageType is one of the three formats supported by the export
  --   command: paint, png or jpeg
  put the alwaysBuffer of stack pStackPath into tOldBuffer
  -- The next two lines force the current card image into the offscreen
buffer
  set the alwaysBuffer of stack pStackPath to false
  set the alwaysBuffer of stack pStackPath to true
  -- create invisible image
  if there is not an img "Gallery Image" then create img "Gallery Image"

  set the imagePixMapID of img "Gallery Image" to (the pixMapID of stack
pStackPath)
  select last image
  set the alwaysBuffer of stack pStackPath to tOldBuffer
 
  put 220 into theTargetSize -- adjust size here
  hide img "Gallery Image"

  put theTargetSize/the formattedwidth of img "Gallery Image" into theRatio
  set the width of img "Gallery Image" to theTargetSize

** it aborts on the following statement the second time *
  set the height of img "Gallery Image" to \
      round(the formattedheight of img "Gallery Image" * theRatio)
  if the height of img "Gallery Image" > 170 then set the height of img
"Gallery Image" to 170
  set the icon of btn "Gallery Button" to the short id of img "Gallery
Image" 

  choose browse tool
end ExportCard

Thanks... Jim
-- 

OYF is... Highly resourceful people working together.
<http://www.OwnYourFuture-net.com>

Own Your Future Consulting Services Limited,
1959 Upper Water Street, Suite 407, Halifax, Nova Scotia. B3J 3N2
Info Line: 902-823-2477, Phone: 902-823-2339. Fax: 902-823-2139







More information about the use-livecode mailing list