Page 1 of 1 [ 10 posts ] 

Scoots5012
Veteran
Veteran

User avatar

Joined: 1 Jul 2004
Age: 45
Gender: Male
Posts: 2,397
Location: Cedar Rapids Iowa

21 Jul 2004, 11:14 pm

Did any of you here ever use Q-basic for DOS at all? When I was in high school I use to spend alot of my free time (which was alot) putzing around with Q-basic, writing and compiling programs. Here's a small example. It's draws a sin wave on the screen based on your input. I did this back in 1995 when I was first figuring out Q-basic and yes.. you programmers can flame me all you want for the poor structure I present to you here.

SCREEN 12 '***256K 640 X 480 GRAPHICS
DO
CLS
COLOR 7
'***GETS INPUT FROM USER*********************************
DO
LOCATE 1, 1: INPUT "WAVE SIZE (1-80 PIXELES, -1 END) ", AMP
IF AMP = -1 THEN : CLS : SCREEN 0: END
LOCATE 1, 1: PRINT " "
LOOP UNTIL AMP >= 0 AND AMP <= 80
DO
LOCATE 1, 1: INPUT "FREQUENCY IN Hz ", FREQ
LOCATE 1, 1: PRINT " "
LOOP UNTIL FREQ >= 0 AND FREQ <= 1000000
DO
LOCATE 1, 1: INPUT "GRAPH LENGTH IN SECONDS ", XVALUE
LOCATE 1, 1: PRINT " "
LOOP UNTIL XVALUE >= .00001 AND XVALUE <= 10
DO
LOCATE 1, 1: INPUT "1-COSINE 2-SINE ", MODE
LOCATE 1, 1: PRINT " "
LOOP UNTIL MODE >= 1 AND MODE <= 2

'***CALCULATES AND ADJUSTS VALUES FOR SINEWAVE************
FREQQ = FREQ
AMPP = AMP
AMP = AMP * 2.4
VALUE = XVALUE / 10
FREQ = FREQ * (XVALUE * 1.85165)
NUM = 640 * FREQ + 100
LASTX = 0
LASTY = AMP
'***PLOTS GRID LINES**********************************
CLS
COLOR 4
FOR i = 1 TO 20
LINE (0, i * 24)-(640, i * 24)
NEXT i
FOR i = 1 TO 20
LINE (i * 64, 0)-(i * 64, 480)
NEXT i
LINE (0, 239)-(640, 239)
LINE (0, 240)-(640, 240)
LINE (0, 241)-(640, 241)
FOR I = 26 TO 30
LOCATE I, 1: PRINT STRING$(80, " ");
LOCATE I - 25, 1: PRINT STRING$(80, " ");
NEXT I
'***PLOTS SINEWAVE**********************
COLOR 1
FOR i = 6.285 TO NUM + 100 STEP 50
IF MODE = 1 THEN : Y = AMP * COS(i)
IF MODE = 2 THEN : Y = AMP * SIN(i)
LINE (LASTX, LASTY + 240)-(i / FREQ, 240 + Y)
LASTX = i / FREQ
LASTY = Y
NEXT i
'***PRINTS ENTERED VALUES*********************
COLOR 4
LOCATE 26, 1: PRINT ; "0";
LOCATE 26, 73: PRINT USING "##.#####"; XVALUE;
LOCATE 28, 1: PRINT "WAVE SIZE "; AMPP;
LOCATE 29, 1: PRINT "FREQUENCY IN Hz "; FREQQ;
LOCATE 30, 1: PRINT "GRAPH SEGMENT VALUE IN SECONDS ";
LOCATE 30, 32: PRINT USING "##.######"; VALUE;
DO
DO
X$ = INKEY$
LOOP WHILE X$ = ""
IF X$ = CHR$(27) THEN : GOSUB ENDLOOP
LOOP
ENDLOOP:
LOOP


_________________
I live my life to prove wrong those who said I couldn't make it in life...


neutron189
Blue Jay
Blue Jay

User avatar

Joined: 1 Jul 2004
Gender: Male
Posts: 80

22 Jul 2004, 9:02 am

Scoots5012 wrote:
Did any of you here ever use Q-basic for DOS at all? When I was in high school I use to spend alot of my free time (which was alot) putzing around with Q-basic, writing and compiling programs. Here's a small example. It's draws a sin wave on the screen based on your input. I did this back in 1995 when I was first figuring out Q-basic and yes.. you programmers can flame me all you want for the poor structure I present to you here.

SCREEN 12 '***256K 640 X 480 GRAPHICS
DO
CLS
COLOR 7
'***GETS INPUT FROM USER*********************************
DO
LOCATE 1, 1: INPUT "WAVE SIZE (1-80 PIXELES, -1 END) ", AMP
IF AMP = -1 THEN : CLS : SCREEN 0: END
LOCATE 1, 1: PRINT " "
LOOP UNTIL AMP >= 0 AND AMP <= 80
DO
LOCATE 1, 1: INPUT "FREQUENCY IN Hz ", FREQ
LOCATE 1, 1: PRINT " "
LOOP UNTIL FREQ >= 0 AND FREQ <= 1000000
DO
LOCATE 1, 1: INPUT "GRAPH LENGTH IN SECONDS ", XVALUE
LOCATE 1, 1: PRINT " "
LOOP UNTIL XVALUE >= .00001 AND XVALUE <= 10
DO
LOCATE 1, 1: INPUT "1-COSINE 2-SINE ", MODE
LOCATE 1, 1: PRINT " "
LOOP UNTIL MODE >= 1 AND MODE <= 2

'***CALCULATES AND ADJUSTS VALUES FOR SINEWAVE************
FREQQ = FREQ
AMPP = AMP
AMP = AMP * 2.4
VALUE = XVALUE / 10
FREQ = FREQ * (XVALUE * 1.85165)
NUM = 640 * FREQ + 100
LASTX = 0
LASTY = AMP
'***PLOTS GRID LINES**********************************
CLS
COLOR 4
FOR i = 1 TO 20
LINE (0, i * 24)-(640, i * 24)
NEXT i
FOR i = 1 TO 20
LINE (i * 64, 0)-(i * 64, 480)
NEXT i
LINE (0, 239)-(640, 239)
LINE (0, 240)-(640, 240)
LINE (0, 241)-(640, 241)
FOR I = 26 TO 30
LOCATE I, 1: PRINT STRING$(80, " ");
LOCATE I - 25, 1: PRINT STRING$(80, " ");
NEXT I
'***PLOTS SINEWAVE**********************
COLOR 1
FOR i = 6.285 TO NUM + 100 STEP 50
IF MODE = 1 THEN : Y = AMP * COS(i)
IF MODE = 2 THEN : Y = AMP * SIN(i)
LINE (LASTX, LASTY + 240)-(i / FREQ, 240 + Y)
LASTX = i / FREQ
LASTY = Y
NEXT i
'***PRINTS ENTERED VALUES*********************
COLOR 4
LOCATE 26, 1: PRINT ; "0";
LOCATE 26, 73: PRINT USING "##.#####"; XVALUE;
LOCATE 28, 1: PRINT "WAVE SIZE "; AMPP;
LOCATE 29, 1: PRINT "FREQUENCY IN Hz "; FREQQ;
LOCATE 30, 1: PRINT "GRAPH SEGMENT VALUE IN SECONDS ";
LOCATE 30, 32: PRINT USING "##.######"; VALUE;
DO
DO
X$ = INKEY$
LOOP WHILE X$ = ""
IF X$ = CHR$(27) THEN : GOSUB ENDLOOP
LOOP
ENDLOOP:
LOOP

Not much good programs where available when dos was around. your program was good in the dos days But you need to drop q-basic and start learning visual basic. I program with visual basic. Visual basic is much more easier and more powerful then q-basic.



sparkplugloy
Deinonychus
Deinonychus

User avatar

Joined: 23 Jun 2004
Gender: Male
Posts: 316
Location: South of France

22 Jul 2004, 1:03 pm

I started to learn Quick Basic when I was eleven years old. A neighbor had gave me and my brother some of the programs he had made and he had explained how it worked. So I programmed a few things, including a calendar (you type the date and it tells you which day it is), a screensaver and a chatting bot with my brother and the neighbor.

Loy


_________________
Nicolas (spark).


Scoots5012
Veteran
Veteran

User avatar

Joined: 1 Jul 2004
Age: 45
Gender: Male
Posts: 2,397
Location: Cedar Rapids Iowa

23 Jul 2004, 5:18 am

Quote:
you need to drop q-basic and start learning visual basic. I program with visual basic. Visual basic is much more easier and more powerful then q-basic.


I've taken some visual basic programming courses in college and passed them with flying colors, and yes visual basic is leaps and bounds above what Q-basic ever was. But for what I'd want to program for, digital video, Assembler or C++ (something along those lines) would be a more appropriate language for me to be using.


_________________
I live my life to prove wrong those who said I couldn't make it in life...


greengeek
Velociraptor
Velociraptor

User avatar

Joined: 18 Jul 2007
Age: 34
Gender: Male
Posts: 434
Location: New York USA

27 Jan 2010, 5:27 pm

I still play QBASIC Gorillas that came with MS-DOS. The Beauty of QBASIC is that you can speed up programs. Gorillas runs really slowly on modern computers if it isn't modified to make it run faster. The had a REM line in the program that told you what value sped up the program.


_________________
Nothing is fool proof only fool resistant


ValMikeSmith
Veteran
Veteran

User avatar

Joined: 18 May 2008
Age: 55
Gender: Male
Posts: 977
Location: Stranger in a strange land

31 Jan 2010, 8:08 am

greengeek wrote:
I still play QBASIC Gorillas that came with MS-DOS. The Beauty of QBASIC is that you can speed up programs. Gorillas runs really slowly on modern computers if it isn't modified to make it run faster. The had a REM line in the program that told you what value sped up the program


You must have a lot of junk on your hard drive.
QBASIC runs fast enough for ME to do video on modern computers. It runs fast enough to record video with a SOUND EDITOR that I wrote about 20 years ago! That's around 1000x faster.
How Ironic it is that old computers run faster than new ones in general. I have been calling the Not-DOS-MS-OS "WINSLOWS" since 1995.
:lol:



pakled
Veteran
Veteran

User avatar

Joined: 12 Nov 2007
Age: 67
Gender: Male
Posts: 7,015

02 Feb 2010, 12:04 am

Windows 95...that was originally referred to as 'win-ever'...weren't it?...;)
I took basic (19..cough cough...83) on an Apple 2 (pre-Mac)...;) Had visual basic at one time, and never got around to using it.
btw--microsoft has a 'baby' version of visual basic on their site...for free...
give 'em the razor...sell 'em the blades...


_________________
anahl nathrak, uth vas bethude, doth yel dyenvey...


greengeek
Velociraptor
Velociraptor

User avatar

Joined: 18 Jul 2007
Age: 34
Gender: Male
Posts: 434
Location: New York USA

08 May 2010, 6:28 pm

Scoots5012 wrote:
Did any of you here ever use Q-basic for DOS at all? When I was in high school I use to spend alot of my free time (which was alot) putzing around with Q-basic, writing and compiling programs. Here's a small example. It's draws a sin wave on the screen based on your input. I did this back in 1995 when I was first figuring out Q-basic and yes.. you programmers can flame me all you want for the poor structure I present to you here.

SCREEN 12 '***256K 640 X 480 GRAPHICS
DO
CLS
COLOR 7
'***GETS INPUT FROM USER*********************************
DO
LOCATE 1, 1: INPUT "WAVE SIZE (1-80 PIXELES, -1 END) ", AMP
IF AMP = -1 THEN : CLS : SCREEN 0: END
LOCATE 1, 1: PRINT " "
LOOP UNTIL AMP >= 0 AND AMP <= 80
DO
LOCATE 1, 1: INPUT "FREQUENCY IN Hz ", FREQ
LOCATE 1, 1: PRINT " "
LOOP UNTIL FREQ >= 0 AND FREQ <= 1000000
DO
LOCATE 1, 1: INPUT "GRAPH LENGTH IN SECONDS ", XVALUE
LOCATE 1, 1: PRINT " "
LOOP UNTIL XVALUE >= .00001 AND XVALUE <= 10
DO
LOCATE 1, 1: INPUT "1-COSINE 2-SINE ", MODE
LOCATE 1, 1: PRINT " "
LOOP UNTIL MODE >= 1 AND MODE <= 2

'***CALCULATES AND ADJUSTS VALUES FOR SINEWAVE************
FREQQ = FREQ
AMPP = AMP
AMP = AMP * 2.4
VALUE = XVALUE / 10
FREQ = FREQ * (XVALUE * 1.85165)
NUM = 640 * FREQ + 100
LASTX = 0
LASTY = AMP
'***PLOTS GRID LINES**********************************
CLS
COLOR 4
FOR i = 1 TO 20
LINE (0, i * 24)-(640, i * 24)
NEXT i
FOR i = 1 TO 20
LINE (i * 64, 0)-(i * 64, 480)
NEXT i
LINE (0, 239)-(640, 239)
LINE (0, 240)-(640, 240)
LINE (0, 241)-(640, 241)
FOR I = 26 TO 30
LOCATE I, 1: PRINT STRING$(80, " ");
LOCATE I - 25, 1: PRINT STRING$(80, " ");
NEXT I
'***PLOTS SINEWAVE**********************
COLOR 1
FOR i = 6.285 TO NUM + 100 STEP 50
IF MODE = 1 THEN : Y = AMP * COS(i)
IF MODE = 2 THEN : Y = AMP * SIN(i)
LINE (LASTX, LASTY + 240)-(i / FREQ, 240 + Y)
LASTX = i / FREQ
LASTY = Y
NEXT i
'***PRINTS ENTERED VALUES*********************
COLOR 4
LOCATE 26, 1: PRINT ; "0";
LOCATE 26, 73: PRINT USING "##.#####"; XVALUE;
LOCATE 28, 1: PRINT "WAVE SIZE "; AMPP;
LOCATE 29, 1: PRINT "FREQUENCY IN Hz "; FREQQ;
LOCATE 30, 1: PRINT "GRAPH SEGMENT VALUE IN SECONDS ";
LOCATE 30, 32: PRINT USING "##.######"; VALUE;
DO
DO
X$ = INKEY$
LOOP WHILE X$ = ""
IF X$ = CHR$(27) THEN : GOSUB ENDLOOP
LOOP
ENDLOOP:
LOOP


I made this program Clear the Screen after Inputing each value so text doesn't overlay on top of text. I also Compiled it in QuickBASIC 4.5.


_________________
Nothing is fool proof only fool resistant


steve30
Velociraptor
Velociraptor

User avatar

Joined: 16 Feb 2007
Age: 34
Gender: Male
Posts: 450
Location: Rotherham

09 May 2010, 7:03 am

I used QuickBasic for my college project last year. I considered Visual Basic but QuickBasic was more suitable for me. There is a brief description on my homepage, http://stevecoates.net/. I will post more details when I get round to it.

I've also done a little bit of BASIC programming on the BBC computer but I don't have a suitable tape recorder or disk drive so I can't easily save what I have done.

I will have a go at running that Sine wave programme later :).



Ichinin
Veteran
Veteran

User avatar

Joined: 3 Apr 2009
Gender: Male
Posts: 3,653
Location: A cold place with lots of blondes.

09 May 2010, 11:34 am

I used Qbasic briefly (*) as i moved onto the PC, then moved on to VB 3.0 and have been using VB right up to VB 2008. VB is good for "Lets make an app fast", C++ is good for performance and Java is good for XPlatform. I wouldnt run VB apps in Linux using Mono and i wouldnt use Java on something that VB did better.

(* One cool thing i did was to use NetCat with QBasic to write a fully functional HTTPD server)


_________________
"It is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring" (Carl Sagan)