Page 1 of 1

new using qbasic

Posted: Mon Dec 26, 2005 2:20 am
by moro145
hii every body i'm working in updating project was developed in qbasic scince 1988 ,i face many problems understanding the code statments such as:

dh=cid-rod : dh2=cid*cid-rod*rod

y(1)=pvd:y(2)=od
IF ABS(y(1)-pvd)>10 GOTO 100

other mater is how to make the program prints the output to a usb printer attached in a network or directly to my computer ?
and how to make the output saved to excell sheet ,if possible?

thanks alot for your worthly help

Re: new using qbasic

Posted: Mon Dec 26, 2005 2:35 pm
by Antoni
moro145 wrote: dh=cid-rod : dh2=cid*cid-rod*rod
Just two assignment statements that could be in separate lines. In QB you can put several statements in the same line by separing them bycolons (:)
moro145 wrote: y(1)=pvd:y(2)=od
Two assignments to the co,ponents 1 and 2 of the array y. There must be a DIM y(size) as type at the start of the program to declara the array
moro145 wrote:
IF ABS(y(1)-pvd)>10 GOTO 100
ABS is th absolute value of the expression if it's bigger than 10 the program jumps to a line labeled with a 100
moro145 wrote:
other mater is how to make the program prints the output to a usb printer attached in a network or directly to my computer ?
You must make the printer available to DOS in the Windows printer settings (It was possible in W98 and W2000, don't know in XP). You assign the printer to a false LPT1 port. Then you can use QBasic's LPRINT.
If this does not work you can print to a file then print with Notepad (It will garble the line drawing characters)

Code: Select all

shell "notepad /p  yourprintfile
moro145 wrote:
and how to make the output saved to excell sheet ,if possible?
To export to Excel write to file using WRITE #. The resulting file is a csv file, easily imported in Excel

BTW: Moro145 sounds strange to spanish ears, as moro is here a derogative. But well, if you like it...:D

Re: new using qbasic

Posted: Mon Dec 26, 2005 2:47 pm
by Guest
Antoni wrote:......
...... you can print to a file then print with Notepad (It will garble the line drawing characters)
Just a note regarding line drawing characters.
In WORD 2003 of Windws XP, you can see line drawing characters by doing the following:
1) Print to a file with a different file extension, like .FIL
2) Get into WORD.
3) Word presents a small window called "File Conversion". In this window, select "OEM United States" from the menu.
4) Word will now show your text with the proper line drawing characters.
5) You can now print this Word file.
*****

Posted: Mon Dec 26, 2005 2:49 pm
by moneo
The above post was mine (Moneo).

I just remembered that the above also worked for me with Word under Windows 2000.
*****

Printing to Network Printer

Posted: Mon Jan 02, 2006 12:24 pm
by Zim
See my response under "Newbie Question: Line Breaks"

Re: Printing to Network Printer

Posted: Mon Jan 02, 2006 1:20 pm
by moneo
zim wrote:See my response under "Newbie Question: Line Breaks"
Sorry, but that response has nothing to do with this thread.
*****Moneo*****

Duh...

Posted: Wed Jan 04, 2006 12:29 pm
by Zim
Sorry, I meant under the topic "QB Coding and Printer questions".

(...fairly new member gets lost in the forum...)