Print card fails first time then works usually

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: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
martyWell
Posts: 4
Joined: Mon Jul 14, 2014 4:04 pm

Print card fails first time then works usually

Post by martyWell » Mon Jul 14, 2014 4:27 pm

Hi! I"m working on a Mac OS app. I read a student's test results from a database and put them into a field on a card. I go invisibly to the cd, then issue a print this card command. The first time I issue the print card command, nothing happens. If I repeat the command, it usually works.

I've tried putting in a confirmation answer step -- which is after the move to the invisible card. Same results. So, for now, I go to the card, show a button and message telling the student to manually print the results if it doesn't work. Then, I issue the print card command. If I do it the other way around, the rest of the code doesn't execute.

I have experimented with

open printing
close printing

This works, but prints a blank page each time, which I don't want.

I'm not new to this kind of programming, but relatively new to Livecode. (Years with ToolBook.)

I should say that I've tested this both in standalone and development. From 2 different Macs (both running Mac OS 10.9.3). This is Livecode 6.6.2. Different printers, too. One network; one USB. No difference.


Any ideas greatly appreciated!

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Print card fails first time then works usually

Post by jmburnod » Mon Jul 14, 2014 6:59 pm

Hi martyWell,

You have to use a print cd message like this

Code: Select all

open printing 
print this cd
close printing
And it should work
Best regards
Jean-Marc
https://alternatic.ch

martyWell
Posts: 4
Joined: Mon Jul 14, 2014 4:04 pm

Re: Print card fails first time then works usually

Post by martyWell » Tue Jul 15, 2014 2:14 pm

Jean-Marc,

Thanks for the quick reply. I tried enclosing the print this cd within the open/close printing. It didn't help.

If I create a new main stack I can print fine -- even without the open/close printing.

I don't know what there is about my stacks that are causing the problem. I have had some crashing issues and at one point I had to save them back to 6.6.2 format.

LiveCode doesn't have any utility to copy everything to a new stack does it?

Marty Weller

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Print card fails first time then works usually

Post by jmburnod » Tue Jul 15, 2014 3:57 pm

Hi Marty,

You can try to save the stack in legacy format and you could open it with a previous version of LiveCode.
Best
Jean-Marc
https://alternatic.ch

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Print card fails first time then works usually

Post by MaxV » Fri Jul 18, 2014 9:52 am

You can use this script: http://livecodeshare.runrev.com/stack/5 ... eporter-LC
to recover all your code and copy it in the new script.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply