Printer problems

In this category you can exchange your programming questions and solutions.
Post Reply
Mel
Posts: 32
Joined: Mon Dec 22, 2008 1:19 pm

Printer problems

Post: # 542Post Mel
Mon Jan 11, 2010 3:37 am

I am working on a program where I send a "sheet" to the printer.  I wanted to print it as dark as possible, so I tried to use "FontBold".  This caused the program to crash.  I then wrote a small test program(posted below) and got the same results.  Does anyone have an idea how for me to procede.

Object canon as printer
 canon.fontname = "Courier New"
 canon.fontsize = 12
 canon.fontbold = true`(If I rem out this line, everything is fine.)
end object

Compiling this gave me this "Runtime error 216 at 00403ca2"
This is on a machine running Windows 98

Mel

magna
Posts: 30
Joined: Tue Nov 08, 2005 3:00 pm

Printer problems

Post: # 543Post magna
Mon Jan 11, 2010 10:36 am

I think you could simply write

Object canon as printer
 fontname = "Courier New"
 fontsize = 12
 fontbold = true`(If I rem out this line, everything is fine.)
end object

If you define an object, its properties can be declared without the name for the object.

Mel
Posts: 32
Joined: Mon Dec 22, 2008 1:19 pm

Printer problems

Post: # 544Post Mel
Mon Jan 11, 2010 12:39 pm

Thanks Magna,  I will try that and see if it works.  I will post back and let you know.
Mel

Mel
Posts: 32
Joined: Mon Dec 22, 2008 1:19 pm

Printer problems

Post: # 545Post Mel
Tue Jan 12, 2010 3:39 am

No.  The same thing happened.  I even tried it a machine running XP and got the same result.  It seems that the line "Canon.fontbold = true" causes a problem.  I even tried "canon.fontitalic = true" and that caused a crash also.  I also tried "dim canon as printer" as the first line and leaving off the statement "end object".  That did not help either.

Mel

magna
Posts: 30
Joined: Tue Nov 08, 2005 3:00 pm

Printer problems

Post: # 546Post magna
Tue Jan 12, 2010 9:08 am

I tried it too and got the same error on XP. If you ommit "fontbold", it works but with this setting it crashes.

Two hints: if you use the "Object"-syntax you dont`t need to use the dot-notation. Just use the name of the property as showed before. In this case there is no need to "Dim" it.

Object canon as printer
 fontname="Courier New"
 fontsize=12
end object

Otherwise you can Dim it, but then you have to set the properties using the dot-notation:

Dim canon As Printer
canon.fontname="Courier New"
canon.fontsize=12

A last hint: remove all whitespaces before and after an equal-sign. I know that FNX has a bug concerning these whitespaces at some place, but I`m not sure if its at this place.

Mel
Posts: 32
Joined: Mon Dec 22, 2008 1:19 pm

Printer problems

Post: # 547Post Mel
Fri Jan 15, 2010 12:54 pm

Magna, I have not been able to do anymore with the "printer problem".  I made some other changes to the program and now I cannot get it to compile.  When I get that fixed I will come back to this.  
Mel

magna
Posts: 30
Joined: Tue Nov 08, 2005 3:00 pm

Printer problems

Post: # 548Post magna
Fri Jan 15, 2010 11:45 pm

If you like to post your code I could try to help you. But the printer problem seems to be unsolvable for now.

Mel
Posts: 32
Joined: Mon Dec 22, 2008 1:19 pm

Printer problems

Post: # 549Post Mel
Sat Jan 16, 2010 12:30 pm

I have already solved the problem with not compiling(needed a variable to be global and it was not).  The problem with "fontbold" seems to be connected with sending to printer.  If you use it while printing to screen, it works fine or it did the little I played with it.
Mel

Post Reply