Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
user32.bi ?
#11
That's where things get interesting... Smile The LPRINT command isn't implemented in FB, so you'll have to use some sort of external printing library - for example, on Win32, you can use the Win32 GDI printer support, which is rather complicated. See http://msdn.microsoft.com/library/defaul...l_62ia.asp for more information than you ever wanted to know.

I'm no expert in the area of printing; perhaps there's a portable library for this that can be ported?
Reply
#12
Hmm, maybe I can save the data to be printed out to a .txt file, then print the .txt file using the SHELL command. I'll try that now!

A few minutes later:

Great!, it worked! This is my code, in FBIDE:
Code:
open "fbtest.txt" for output as #1
  print #1, "This is the printout"
  print #1, ""
  print #1, "And this is 'The End'"
close

shell " PRINT fbtest.txt > LPT1"
And the printer spit out,

This is the printout

And this is 'The End'


So, maybe this is the way to go for text data.

Does anybody have a better method?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#13
Ralph welcome to FB :wink:

while FBIde is just a program that let's you to easily write the FB code -you really could use even Notepad for that. and compile your program from a) command line: "fbc yourfile.bas" b) In windows dragging your file over the fbc.exe.

And FB is not 100% compatable with QB, but comes close to.
url]http://fbide.sourceforge.net/[/url]
Reply
#14
VonGodric:
Thank you.

As to using Windows' RUN, then entering
fbc fbProg.bas
to compile a program, I now understand well.

As to dragging the fbProg.bas on fbc.exe to compile it, WOW!

As I wrote above, thank you. But, my problem is not in writeing the program using Notepad or any other such program, but, rather, in writeing it within a program that prompts me everytime I make a syntax error or a compile error, which both QuickBASIC and FBIDE do. I make frequent mistakes in syntax, this is a fact in my life, and I need all the prompting help that I can get.

For instance, in the "old QuickBASIC program" that I managed to run in FBIDE, I had a line similar to this, which works well in QB:

IF A = 3 OR B = 5 THEN

FBIDE reported an error "found: OR", and gave me the line number. I tried various ways of solving this, and, finally, came up with the thought that FB doesn't accept two statements connected with an OR (or any other connective word, I guess), so, I changed the line to:

IF (A = 3 OR B = 5) THEN

and, it worked, since the statement with parenthesis is either TRUE or FALSE, making me think that FB only accepts one IF statement at a time, so to speak

Now, if I had simply written the 300 lines or so of code in Notepad and compiled it, I don't know what would have happened! There were about four instances of "lonely" ORs, 30 instances of LPRINT, about 10 one-line instances of IFs which worked in QB, but not in FBIDE, and some others. FBIDE pointed me to the QB syntax not acceptable to FB and allowed me to change things until they worked, all in a user-friendly environment. If I had to SAVE the file, try to compile it in FBC, come back to the IDE, change, SAVE, compile again ... I think I would have given up! Even though I am beginning to see that a patteren would be established, making SAVING, compiling, correcting more of a continuous effort, not so bad as i originally thought. But, I still like the IDE way better. Seems to me that staying within the same program all the time is easier on my one-track mind!

I can imagine that there are others out there who don't have the memory or the knowledge to write a FB program correctly in Notepad, and are very thankful for those who make the IDE programs with so much help! Yes, VERY thankful! And also thankful to those who show us how to get the IDEs, too!
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#15
Hehe -I more meant to point out the possibility, but not to actually force you to use notepad or anythin :wink:

and FBIde catches compiler output from console, but doesn't do by itself any error checking. (trust me couse I know how FBIde works... or should at least Tongue )
url]http://fbide.sourceforge.net/[/url]
Reply
#16
VonGodric wrote:
Quote:and FBIde catches compiler output from console, but doesn't do by itself any error checking.
I accept your knowledge. But, to me, a humble user, it seems as if FBide is doing it all! After all, I am "only" running FGide, so, if it reaches out to other files, as I know it does to Windows' files, it is all fairly transparent to me, and I still "feel" that it is this wonderful IDE that is doing it all! Smile

You also wrote, "I know how FBide works...or should, at least". Did you, perhaps, create this IDE?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#17
Btw,
Code:
IF A = 3 OR B = 5 THEN
is completely valid, no parenthesis are needed, problem was probably something else.
Reply
#18
v3cz0r:
You are so right! But, I wasn't able to repeat the problem, either. I reverted to the no-parenthesis form of
IF A = 5 OR B = 3 THEN
in every instance (about ten or more), and, the program runs fine.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#19
Ralph: Yes FBIde is written by me :wink: err...

v3cz0r: I'v noticed that sometimes, especially with more complex stataments it goes grazy -so adding () a helps a lot. And I think it helps to keep code cleaner and easier to read.
url]http://fbide.sourceforge.net/[/url]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)