go cd opens revStartCenter

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
THOLIEN
Posts: 11
Joined: Mon Jul 02, 2018 6:03 pm

go cd opens revStartCenter

Post by THOLIEN » Thu Nov 08, 2018 9:43 pm

This issue is related to a post in the liveforum called "go to stack exits handler" - link here:
http://forums.livecode.com/viewtopic.ph ... er#p161392

This issue is also related to bug # 20770.

Maybe this will add a little more information to the known problem. But until the problem is resolved I would like a work around. The work around listed in the forum post did not work for me.

Here is my story.
I have two different stack files that function very similarly. The software creates a list of items used to build something then prints the list to pdf. The part I am interested in is printing.

Here is the section of code that is causing problems.

Code: Select all

   open stack "PRT2"
   go cd 1 of stack "PRT2"
   put TBL1 into fld "f1"
   put TBL2 into fld "f2"
   put GT into fld "grndtot"
   put LT into fld "info"
   set printScale to .85
   set printMargins to 36,36,36,36
   open printing
   set the height of stack "PRT2" to 900
   set the height of fld "f2" of card 1 of stack "PRT2"  to 578
   print card
   close printing
   close stack "PRT2"
What this should do is create a card that looks normal when printed. See attachment "Good Report".Image
What it actually does is create a card that looks "blacked out" when printed. See attachment "bad report".Image
So, I went looking for differences between the stack that works and the one that does not, that sort of thing.

I looked at the stack file that was working and found a difference so I changed it. The last line "close stack "PRT2"" was changed to "pop cd".
This created a mess. The script debugger stopped in a livecode stack called "revStartCenter" at the line before the "else" which sets the backgroundColor with this error: "button "Behavior Script": execution error at line 50 (Function: error in function handler) near "uiColor", char 64"

Code: Select all

setprop dgHilite pBoolean   
   -- Example:
   if pBoolean then
      set the foregroundColor of widget "icon" of me to 255,255,255
      set the textColor of field "stackLabel" of me to 255,255,255
      set the textColor of field "stackPath" of me to 255,255,255
      set the backgroundColor of graphic "background" of me to uiColor("edition")
   else
      set the foregroundColor of widget "icon" of me to uiColor("edition")
      set the textColor of field "stackLabel" of me to empty
      set the textColor of field "stackPath" of me to uiColor("mid grey")
      set the backgroundColor of graphic "background" of me to uiColor("recentFilesBackground")
   end if
end dgHilite
This sort of makes sense because the report lines are "blacked out" probably due to this line not running.
But this DOES NOT MAKE SENSE because I have no idea WHY revStartCenter is failing.

I have added "on openstack" to the PRT2 stack as mentioned in the forum discussion noted at the beginning but that did not work for me.
The card that is being printed is good. The pdf is bad.

So, what can I do to get this report to print nicely?
bad report.png
bad report
bad report.png (17.69 KiB) Viewed 79 times
Attachments
Good Report.png
good report

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”