BBC BASIC for Windows
« Printing »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:58pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Printing  (Read 737 times)
JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 47
xx Printing
« Thread started on: Jul 10th, 2010, 12:47pm »

This thread is not about printing text to the output window, it's abut printing text to the printer. I know how to do it on the normal output window, but how do you print the text that someone has typed in the edit window. This window:

Hedit% = FN_createwindow("EDIT", "", 0, 0, @vdu%!208, @vdu%!212, 0, &200044, 0)

Please help!
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Printing
« Reply #1 on: Jul 10th, 2010, 9:14pm »

on Jul 10th, 2010, 12:47pm, JB91 wrote:
how do you print the text that someone has typed in the edit window.

There are various ways you might do it but the easiest is probably to read the text out of the edit control and then send that to the printer conventionally. Something like the following will work:

Code:
      SYS "SendMessage", Hedit%, WM_GETTEXTLENGTH, 0, 0 TO L%
      SYS "GlobalAlloc", 0, L%+1 TO F%
      SYS "SendMessage", Hedit%, WM_GETTEXT, L%+1, F%
      *OUTPUT 15
      PRINT $$F%
      *OUTPUT 0
      VDU 2,1,12,3
      SYS "GlobalFree", F% 

Richard.
User IP Logged

JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 47
xx Re: Printing
« Reply #2 on: Jul 12th, 2010, 7:28pm »

I have a menu in my program and when I click Print it goes to PROCprint. Am I supposed to put the code there? If so, it comes up with the error of "no such variable"

Please reply
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Printing
« Reply #3 on: Jul 12th, 2010, 8:41pm »

on Jul 12th, 2010, 7:28pm, JB91 wrote:
If so, it comes up with the error of "no such variable"

A 'No such variable' error should be easy to debug. Using the highlighting in the editor window along with the List Variables utility it should be straightforward to discover what variable it is complaining about.

As the code I listed contains Windows Constants, make sure to run Michael Hutton's 'Add Windows Constants' utility to insert the necessary definitions automatically (or do it yourself manually using API Viewer or whatever your preferred Windows API Reference is).

Richard.
« Last Edit: Jul 12th, 2010, 8:42pm by admin » User IP Logged

JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 47
xx Re: Printing
« Reply #4 on: Jul 14th, 2010, 6:56pm »

Thanks, it works!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls