|
-
Jun 11th, 2000, 11:22 PM
#1
Thread Starter
Member
Hello! I just got qbasic 7.1 and I have no fricken idea how to use it. I know some vb and I thought it was like qbasic. Currently all I know to do is
Code:
PRINT "Hello Self"
PRINT "I'm Bored!"
PRINT "Please feel free to shoot me at this time!"
Things I need to know how to do:
- Create the qb equivelant of a textbox so I can get data
- control the colors and fonts and font sizes and stuph like that
- anything else you can think of that a ignert newbie could use.
Charlie Staton
14 y/o
I don't smoke, I don't drink, and I don't assosciate with pokemon.
-
Jun 11th, 2000, 11:28 PM
#2
Thread Starter
Member
oh yeah and I would also like to be able to diplay a bitmap file and maybe play a midi file(if that's not too complicated)
Charlie Staton
14 y/o
I don't smoke, I don't drink, and I don't assosciate with pokemon.
-
Jun 12th, 2000, 07:08 AM
#3
Use can use Input to recieve in put from the user...
It's a start
-
Jul 1st, 2000, 08:06 PM
#4
New Member
Create the qb equivelant of a textbox so I can get data
Use the INPUT or LINE INPUT commands for this...
control the colors and fonts and font sizes and stuph like that
You can't change use fonts or font sizes in text mode.. You can, however, change the text color using the COLOR command. For example: COLOR 12,1 where 12 is the foreground color and 1 is the background color.
oh yeah and I would also like to be able to diplay a bitmap file and maybe play a midi file(if that's not too complicated)
QBasic cannot do this by itself, but there are programs available that can do this. Check out http://www.qbasic.com, I know they have what you need.
If you have any other questions, just ask 
Stefen Enns ( [email protected] )- Visual Studio PRO 6 SP3
 - Turbo Pascal 7.0
- Borland Delphi 5
- C++Builder 4 ENT
- Perl
- ASP/VBScript
-
Jul 2nd, 2000, 10:15 AM
#5
I believe that there is a 3rd parameter for the color in certian Screen modes.
Code:
COLOR Foreground, Background, Border
Also, about Fonts, I do not think you can choose any. All you can have is the standard Terminal font. You can switch to different Screen Modes to draw graphics and display the screen at a different resolution.
Code:
SCREEN 7
PRINT "Hello"
-
Jul 2nd, 2000, 12:12 PM
#6
Member
Check these out.
Code:
'This example requires a color graphics adapter.
Screen 13
VIEW (10, 10)-(300, 180), , 1
LOCATE 1, 11: Print "A big graphics viewport";
VIEW SCREEN (80, 80)-(200, 125), , 1
LOCATE 11, 11: Print "A small graphics viewport";
Code:
' Shadowed window routines by Mark H Butler placed into the public domain
' on February 28, 1992 (bye bye babies). I would appreciate any feedback
' on these routines and if you improve on them I'd kinda like to know what
' you did so I can benefit by the improvements to. If that's a deal then
' enjoy the routines... there all yours now.
DECLARE SUB Drawbox (UpRow%, LtCol%, LoRow%, RtCol%)
DECLARE SUB Shadow (UpRow%, LtCol%, LoRow%, RtCol%)
DECLARE SUB Explode (UpRow%, LtCol%, LoRow%, RtCol%)
DECLARE SUB Expand (UpRow%, LtCol%, LoRow%, RtCol%)
DECLARE SUB ScreenClear (LineColor%)
DECLARE SUB Delay (ticks!)
' These first lines of code are included to demo the
' exploding and expanding window routines.
' We'll fill the sceen with a bunch of crap so our windows
' will have a backdrop you can see their shadows against.
LOCATE , , 0
Color 14, 1
Cls
For I = 1 To 13
For ch = 33 To 178
Print Chr$(ch);
Next ch
Next I
Color 4, 7
Explode 5, 15, 15, 65
Color 0
LOCATE 9, 27
Print "This 'exploding' window was"
LOCATE 10, 25
Print "written entirely in QuickBASIC! "
LOCATE 12, 21
Print "(press any key for the 'Expand' routine)"
SLEEP
Color 0, 3
Expand 2, 5, 22, 75
Color 4
LOCATE 8, 12
Print "This is the 'Expand' routine. Like 'Explode' it calls"
LOCATE 9, 12
Print "the 'Drawbox' routine. It expands to it's full horizontal"
LOCATE 10, 12
Print "width *before* it begins to expand vertically though."
LOCATE 13, 12
Print "(press any key for some semi-fancy screen clearing)"
SLEEP
ScreenClear 3
Static Sub Drawbox(UpRow%, LtCol%, LoRow%, RtCol%)
' This routine draws a double line box to the dimensions set
' in UpRow%, LtCol%, LoRow% and RtCol%. If you want a single line box
' just change the ascii chars, e.g. change CHR$(205) to CHR$(196) etc.
'
Wide% = (RtCol% - LtCol%) - 1
LOCATE UpRow%, LtCol%
Print Chr$(201); String$(Wide%, Chr$(205)); Chr$(187);
For I% = UpRow% + 1 To LoRow% - 1
LOCATE I%, LtCol%
Print Chr$(186); Space$(Wide%); Chr$(186);
Next I%
LOCATE LoRow%, LtCol%
Print Chr$(200); String$(Wide%, Chr$(205)); Chr$(188);
End Sub
Static Sub Expand(UpRow%, LtCol%, LoRow%, RtCol%)
' This routine will "expand" the window onto the screen calling on
' DRAWBOX to draw sucessively wider boxes until it hits the width
' dimensions. Then it will expand to meet the vertical dimensions.
'
RowCenter% = ((LoRow% - UpRow%) / 2) + UpRow%
ColCenter% = ((RtCol% - LtCol%) / 2) + LtCol%
UprRow% = RowCenter%: LeftCol% = ColCenter%
LwrRow% = RowCenter%: RghtCol% = ColCenter%
Do
LeftCol% = LeftCol% - 1
RghtCol% = RghtCol% + 1
If LeftCol% < LtCol% Then LeftCol% = LtCol%
If RghtCol% > RtCol% Then RghtCol% = RtCol%
Drawbox UprRow%, LeftCol%, LwrRow%, RghtCol%
If LeftCol% = LtCol% And RghtCol% = RtCol% Then Exit Do
Loop
Do
UprRow% = UprRow% - 1
LwrRow% = LwrRow% + 1
If UprRow% < UpRow% Then UprRow% = UpRow%
If LwrRow% >= LoRow% Then LwrRow% = LoRow%
Drawbox UprRow%, LeftCol%, LwrRow%, RghtCol%
If UprRow% = UpRow% And LwrRow% = LoRow% Then Exit Do
Loop
Shadow UpRow%, LtCol%, LoRow%, RtCol%
End Sub
Static Sub Explode(UpRow%, LtCol%, LoRow%, RtCol%)
' This routine will "explode" the window onto the screen calling on
' DRAWBOX to draw sucessively larger boxes until it hits the limits
' set in UpRow%, LtCol%, LoRow% and RtCol%. The first few lines determine
' where the approximate center of the box begins even if the window is
' to be located off-center with respect to the screen.
'
RowCenter% = ((LoRow% - UpRow%) / 2) + UpRow%
ColCenter% = ((RtCol% - LtCol%) / 2) + LtCol%
UprRow% = RowCenter%: LeftCol% = ColCenter%
LwrRow% = RowCenter%: RghtCol% = ColCenter%
Do
UprRow% = UprRow% - 1
LeftCol% = LeftCol% - 3
LwrRow% = LwrRow% + 1
RghtCol% = RghtCol% + 3
If UprRow% < UpRow% Then UprRow% = UpRow%
If LeftCol% < LtCol% Then LeftCol% = LtCol%
If LwrRow% > LoRow% Then LwrRow% = LoRow%
If RghtCol% > RtCol% Then RghtCol% = RtCol%
Drawbox UprRow%, LeftCol%, LwrRow%, RghtCol%
If UprRow% = UpRow% And LeftCol% = LtCol% Then
If LwrRow% = LoRow% And RghtCol% = RtCol% Then
Exit Do
End If
End If
Loop
Shadow UpRow%, LtCol%, LoRow%, RtCol% '*** now give it a shadow ****
End Sub
Static Sub ScreenClear(LineColor%)
'This routine will do a little fancy screen clearing by simulating
'an old style 1950s TV set being shut off. Screen shrinks to a single
'horizontal line then disappears to a shrinking dot and is gone.
'I wrote it for 80x25 text mode so if your displaying more screen lines
'than 25 you'll have to play with it to get it to erase them all.
'
LOCATE , , 0
Dim Lines$(1 To 23)
Lines$(1) = String$(80, Chr$(196))
Sp% = 2
Length% = 76
For I% = 2 To 21
Lines$(I%) = Space$(Sp%) + String$(Length%, Chr$(196)) + Space$(2)
Sp% = Sp% + 2
Length% = Length% - 4
Next I%
Lines$(22) = Space$(39) + Chr$(254) + Space$(2)
Lines$(23) = Space$(39) + "." + Space$(2)
Color 0, 0
x% = 1
y% = 25
For I% = 1 To 12
LOCATE y%, 1
Print String$(80, Chr$(32));
LOCATE x%, 1
Print String$(80, Chr$(32));
Delay 0.04
x% = x% + 1
y% = y% - 1
Next I%
Color LineColor%, 0
For I% = 1 To 23
LOCATE 13, 1
Print Lines$(I%);
Delay 0.04
Next I%
Color 7
LOCATE , , 1, 6, 7
Cls
End Sub
Static Sub Shadow(UpRow%, LtCol%, LoRow%, RtCol%)
' This routine creates a transparent shadow along the right side
' and bottom edge of the box. Note: Special thanks to John Strong
' for his very helpful tips on what to POKE and where.
'
DEF SEG = &H40
mono% = PEEK(&H10)
If (mono% And 48) = 48 Then
Exit Sub '*** Forget the shadow if it's monochrome.
Else
DEF SEG = &HB800
End If
'****** find out what the screen attributes already are ****
attr% = Screen(LoRow% + 1, RtCol% + 1, -1) ' Get the attribute.
attr% = attr% And 15 ' Calculate forground.
attr% = attr% - 8 ' Remove bright.
If attr% < 1 Then attr% = 8 ' In case color wasn't bright.
'****** use the given box dimensions to POKE a ***********
'****** shadow on the right side and bottom edge *********
For row% = UpRow% + 1 To LoRow% + 1 '***** right edge locations.
For Col% = RtCol% + 1 To RtCol% + 2 '***** make it 2 chars Wide.
offset% = (row% - 1) * 160 + (Col% - 1) * 2 + 1
POKE offset%, attr%
Next
Next
row% = LoRow% + 1 '***** now POKE along the
For Col% = LtCol% + 2 To RtCol% + 2 '***** bottom edge
offset% = (row% - 1) * 160 + (Col% - 1) * 2 + 1
POKE offset%, attr%
Next
DEF SEG
End Sub
Sub Delay(ticks!)
'The next sub is just a little delay that ScreenClear needs
'
begintime! = Timer
Do
Loop Until Timer - begintime! > ticks!
End Sub
I've got another program that I wrote that makes
a message box 3d just like windows, but I can't
find it right now.
I'm still looking....
[Edited by catocom on 07-03-2000 at 01:35 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|