Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Printer commands?

Author
Message
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 13th Jul 2009 21:15
Are there any printer commands in DB?

I need to print out a message from my game.


Thanks!

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 13th Jul 2009 21:30
you mean like the printer that prints out pictures or MSWord documents?

if so then idk, there probably is a DLL but I wouldnt know about it

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Jul 2009 22:24
You can buy DarkInk that allows you to print text/graphics to the printer. It's very useful and brings back the old LPRINT command too.

http://darkbasicpro.thegamecreators.com/?f=darkink

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 13th Jul 2009 22:45
Quote: "You can buy DarkInk that allows you to print text/graphics to the printer. It's very useful and brings back the old LPRINT command too. "


It says DB Pro.. not sure about DB Classic.

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Jul 2009 00:01
You can use the command prompt, don't remember the exact call though. It only works for serial printers though, no USB.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Jul 2009 02:41
Oops, sorry I wasn't paying attention to where I was. Yeah it's for Pro only.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th Jul 2009 02:57
And if you don't mean print out on to paper, but print text to the screen, look at:

-print "text"
-text x,y,"text"
-center text x,y,"text"

For more information about these commands press f1 from the editor and search for them.

TheComet


Make the path of your enemies easier with Waypoint Pro!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Jul 2009 03:28
@Pincho
If you are talking about using the printer: before I knew how to write DLLs or when I plain just didn't feel like writing one, I'd use another BASIC that could create an exe of the function I wanted (like printing) and call that exe using EXECUTE FILE - passing the necessary arguments.

Enjoy your day.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Jul 2009 14:01
Quote: "@Pincho
If you are talking about using the printer: before I knew how to write DLLs or when I plain just didn't feel like writing one, I'd use another BASIC that could create an exe of the function I wanted (like printing) and call that exe using EXECUTE FILE - passing the necessary arguments."


So I could make the file in Visual Basic, and then call it. I think I will do that then thanks!

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th Jul 2009 18:03
You could probably use that dbp dll with call dll and load dll.

or just load up a windows dll. though thats not very portable at all. :/

New Site! Check it out \/
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Jul 2009 22:13
Quote: "or just load up a windows dll. though thats not very portable at all. :/"


Showing my ignorance here, but couldn't you just package the windows dll with the program?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Jul 2009 00:13
Well i don't think that microsoft would like that very much. idk though. never had to.

I just would take the risk of somehow microsoft getting on your back about you distributing there dll's.

plus they probably need windows to run. so if you stuck user32.dll in a program and tried to call ummmmm GetCursorPos() i think thats the function, then it probably would work on a mac. lol

New Site! Check it out \/
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2009 00:38
I don't think you can actually print just using dll calls from the win api. I believe there is a necessary callback function that has to be created. There may be a way around that, I don't know though.

Enjoy your day.
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Jul 2009 03:36
Either way it isn't the best way to go as if someone tries it on another OS then it's gunna crash.

Your better to just try and use the dbp dll. i don't see why it wouldn't work.

New Site! Check it out \/
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Jul 2009 04:07
I think the make a program in another language to print it would be the simplest solution (could probably make it using code found on google)

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jul 2009 05:00 Edited at: 15th Jul 2009 05:12
Here's a little trick if you have mspaint installed on your computer. You can use it to print any bitmap that you save. This example is the whole screen. You may want to change the background to white or else all of your black ink will be used up:



I think you can do the same with Notepad.exe and /p if you use a text file.

Enjoy your day.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Jul 2009 06:06
cool i didnt know DBC could access other programs

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 15th Jul 2009 18:24
Quote: "cool i didnt know DBC could access other programs"


Execute File "ExeFileName","CommandLine","ExeFilePath"

Course i said exe but it can be a batch, hta, or something lol.

Just a hint, you can actually debug, run and create a exe of a darkbasic source file from darkbasic by running db.exe with the command line as this:

One of these
\/
-x,-f,-c,-b PathToDbSource

-x is Run
-c is Compile
-f is Build Final
-b is Build EXE

don't run a full screen db file from a full screen db file though. if one of them is windowed then its fine otherwise you will get a "Failed to setup DirectDraw" or something like that error.


Latch:

Thats great! didn't know you could do that!

Sad thing is it still only works on Windows, but whatever thats a easy way to do something if it's going to be on windows.

Unless the person deleted MsPaint.... i heard someone did that on here lol

New Site! Check it out \/
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 18th Jul 2009 12:39
Quote: "Here's a little trick if you have mspaint installed on your computer. You can use it to print any bitmap that you save. This example is the whole screen. You may want to change the background to white or else all of your black ink will be used up:







I think you can do the same with Notepad.exe and /p if you use a text file."


Handy. what I am actually doing is making a fortune telling program that prints out your results. So Notepad is my preferred method.

Login to post a reply

Server time is: 2024-05-20 12:36:53
Your offset time is: 2024-05-20 12:36:53