Can anybody Please help

I want to print the result of data manipulation from a program using the printer, however, the printer does not print as long as the program is running. As soon as the program terminates the printer prints the data as directed by the program. The printer is a Brother
HL-5250DN or a Brother DCP-9045CDN. I also have an HP printer but nothing prints on it from TB not even "list."

Comments

Make shift result

What Im about to suggest involves several factors. It depends on OS, and if you are only interested in printing an image of the result. If you are running windows vista id suggest using the snipping tool to take a screenshot of the desired area that requires being printed, then print using photoshop or paint or whatever you use for images. If you are using windows xp then you need to use whatever screen shot tool is included with xp. If you are not interested in printing an image of what is being done in the program, then im sorry this was a useless reply.

bubbachunk's Reply

bubbachunk...please be assured that your reply to inquires is NEVER useless.

That said, I'm attempting to print just numbers or text...nothing fancy. It just seems like the program latches on to the printer output and won't allow the data to be printed until the program terminates. I'm using XP. I tried binding the program and running it as an application...same result.

My first point of frustration is the seemingly lack of caring on the part of the TB team. I realize that one of the founders of TB has passed away. But, the other founder is still active but seems to not care about the product.

I'm not sure how one can justify selling a product such as TB without support and simply depending on the goodwill of its users to provide support and answers.

have you tried....

Ok First I'm going to use a quote from your post

"It just seems like the program latches on to the printer output and won't allow the data to be printed until the program terminates. I'm using XP. I tried binding the program and running it as an application...same result."

From what I have read in these forums Ive never really heard about using anything like bind. What I have heard though is something called CHAIN. I personally don't know how to use CHAIN, But the True Basic Manual says the following...

The following statements are not discussed in this book but appear in the HELP facility.
FUNCTION DECLARE NUMERIC
FUNCTION Structure DECLARE STRING
EXIT FUNCTION DECLARE SUB
END FUNCTION CHAIN

And then the HELP facility says the following...

I went into help and couldnt even find the topic. I went into tbtutor for tb silver and couldnt find it there either.

A previous post on this website includes the following...
Before you read this Im ganna tell you that this is trying to CHAIN to either music or a video program. But you would be trying to CHAIN to a printer so I think it would be kind of the same concept.

True Basic cannot play a .wav or other sound file directly. You can only accomplish this with an externall function call to a .dll library if you have an appropriate one or by chaining to an external player.

Here is information from the True Basic forum:

re:sound/music

The manual leaves out the fact that the first character after CHAIN needs to be "!". The subroutine below chains out to a REALPLAYER to show a file vidname$. The defdir$ is the location of the real player file, player$ is the actual player file name.

For example
LET defdir$ = "C:\Program Files\Real\RealPlayer\"
LET player$ = "realplay.exe"
The rest of the command and the ASK DIRECTORY statements are so that the Chain command can find the file no matter where a user might place the main program and data files.

SUB SHOWVIDEO(vidname$)
ASK DIRECTORY dir$
CHAIN "!"&defdir$&player$&" file://"&dir$&"\videos\"&vidname$&".RM",…
END SUB

This is one of the major weak spots in True Basic. To my knowledge, the only way to do this is to write an external suproutine in some language (C, C++) that supports the music and then try and figure out how to bind it into your true basic program. This is not at all easy (been there, tried it with help, and still didn't get something that worked properly). You can CHAIN out to a player--I do that to chain to a video player in some programs, but that will not play music WHILE your true basic program is operating. You might get music to play over a title screen this way, but fundamentally True Basic does not support sound and music (other than simple sounds through the internal speaker).

I hope this helps.

Thanks again bubbachunk

By bind I mean I made an .EXE file out of the .BAS file. You can find this term under the "Run" menu.

Let me try this. This simple routing demonstrates what I'm talking about:

open #1: Printer

for x = 1 to 10
print#1: "This is a test"
next x

end

On my computer, the printer does nothing until I click the big red X in the upper right corner and then the printer prints 10 lines of "This is a test."

If I do not click on the big red X absolutely nothing happens...the program does not stop and the printer does not print.

Try this on your machine and let me know if your's works ok.

open #1: Printer

for x = 1 to 10
print#1: "This is a test"
next x

end

************UPDATE*************

While I'm relatively new to TB I used BetterBasic back in the 1980's quite extensively so I'm still learning the little quirks of TB.

I was on page 107 of the "Programming in True Basic" 2nd Edition by Venit & Schleiffers. There it shows a Swimming Pool Calculation training program. The output of this program goes to the printer. On page 108 there is a note that says "A CLOSE(device #1) statement MAY be used to close an opened device. Notice it says MAY indicating the statement is not necessary.

I put a Close statement in this little routine and it now works as it should...this problem is solved.

I NOW see on page 24,24 of TB Silver manual that the close statement is necessary.

bubbachunk I thank you profusely for your help. The trouble is you can't help me when I have a brain cramp.

HEY

you mentioned that book I have that same book. I'm glad I could sort of help