How Can You Print Your BASIC Program and Its Output?

In summary, the conversation discusses the importance of BASIC syntax and drawing flowcharts, particularly for beginners. The topic of QBASIC is also brought up, with one individual expressing difficulty in finding information and another recommending tutorials and Google as resources. The conversation then shifts to discussing the process of printing output in QBASIC, with various suggestions and tips shared among the participants. Overall, the conversation provides helpful insights and tips for those learning and using QBASIC.
  • #1
nwadimoore
8
0
BASIC syntax, drawing flowcharts, QBASIC
 
Technology news on Phys.org
  • #2
This may be old but still important for freshers
 
  • #3
I need to find some info on the QBASIC. I still find it hard.
 
  • #4
Is anyone there?
 
  • #6
Wow! Thanks, Pantaz. I think I'm doing well with the programming, but my headache lies on how to print the output on a paper. So far, if i try to print, only the program is print out. I want both the program and output to print on paper. How possible is it?
 
  • #7
Wow, Qbasic! I am amazed that this is still in use anywhere.

To print from a program

10 Print "Hello world"


Isn't that the universal first program to write in basic?

Suppose you have some variable x.

10 Print x


you can combine strings and variables:

10 Print "This is x "; x

The semi colon means that no space it left between the previous element printed. If you use a comma then it will space out to the next tab field.

10 for i = 1 to 10
20 print i
30 next i

Outputs
1
2
3
4
5
6
7
8
9
10

10 For i = 1 to 10
20 print i;
30 next i

Outputs
12345678910

That should get you started.
 
  • #8
Integral said:
Wow, Qbasic! I am amazed that this is still in use anywhere.

I still use GWBasic from time to time, which is even older than QBasic. I was working with computers when GWBasic was first introduced. It doesn't seem like all that long ago and yet, it's been roughly 3 decades. Time sure flies when you're having fun. :wink:
 
  • #9
I still have "Qbasic in 21 days" picking up dust on the bookshelf. I believe the latex complier that came out eons ago was QB 4.5, try googling that. The compiler also has a comprehensive syntax library.

Here's some more code

CLS
SCREEN 12

WINDOW (-10,-10)-(10,10)

FOR R = 0 To 10

CIRCLE (0,0), R

NEXT R
 
  • #10
Thanks, Integral. Gnosis. Waht. My idea in BASIC programming is ok. But the issue lies on printing out the program and its output on paper.
 
  • #11
nwadimoore said:
Thanks, Integral. Gnosis. Waht. My idea in BASIC programming is ok. But the issue lies on printing out the program and its output on paper.

Use LPRINT instead of PRINT.

My decades-dormant QBasic comes in handy again!
 
  • #12
Thanks, CRGreathouse. U did well. It worked. But is there any way the input statement will appear on paper too.
 
  • #13
nwadimoore said:
Thanks, Integral. Gnosis. Waht. My idea in BASIC programming is ok. But the issue lies on printing out the program and its output on paper.

I'm sorry, I overlooked your need to print.

If you simply need to print everything that's visible on the screen, trying pressing the "Print Screen/SysRq" key while the printer is on-line. It generally takes at least two presses of this key (sometimes a 3rd press) for printing to commence, as each press of the key typically only fills half of the printer's paper (captures the entire screen, but that only fills half of the paper) and it's only buffered, not printed until a whole page worth of screen captures have occured. So press the key once, then list another full screen of your program, then press the key again and the printer will typically begin printing everything from the two screens that you captured.

In some cases, I have seen it require a 3rd press of the key, but usually only two key presses prints out a page.
 

1. What is BASIC programming language?

BASIC (Beginner's All-purpose Symbolic Instruction Code) is a high-level programming language that was designed in the 1960s for beginners to learn programming in a simple and easy to understand manner. It is still used today for teaching programming concepts and for creating small programs.

2. What are the advantages of programming with BASIC?

One of the main advantages of BASIC is its simplicity and ease of use. It has a straightforward syntax and is easy to learn, making it an ideal language for beginners. It also allows for quick development of programs and has a wide range of built-in functions and commands.

3. Can I create complex programs with BASIC?

Yes, while BASIC is often used for simple programs, it is also capable of creating more complex programs. It has features such as loops, arrays, and subroutines that allow for more advanced programming. It can also be used for creating graphical user interfaces and games.

4. Is BASIC still relevant in modern programming?

While BASIC is not as commonly used as it once was, it still has its place in modern programming. Many programming languages have been influenced by BASIC and its simple syntax, and it is still used for certain applications such as educational software and small embedded systems.

5. Can I use BASIC for web development?

While BASIC was not originally designed for web development, there are versions of it that have been adapted for creating web applications. These versions include features such as HTML and JavaScript integration, making it possible to create basic web applications using BASIC.

Similar threads

  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
2
Replies
65
Views
2K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
1
Views
726
  • Programming and Computer Science
Replies
8
Views
874
  • Programming and Computer Science
Replies
2
Views
775
  • Programming and Computer Science
Replies
4
Views
971
  • Programming and Computer Science
Replies
22
Views
749
Back
Top