Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 483
» Latest member: aplus
» Forum threads: 2,795
» Forum posts: 26,345
Full Statistics
|
Latest Threads |
GNU C++ Compiler error
Forum: Help Me!
Last Post: bplus
21 minutes ago
» Replies: 21
» Views: 272
|
What do you guys like to ...
Forum: General Discussion
Last Post: Pete
1 hour ago
» Replies: 11
» Views: 155
|
Mean user base makes Stev...
Forum: General Discussion
Last Post: Pete
Yesterday, 06:39 PM
» Replies: 8
» Views: 225
|
Fast QB64 base64 encoder ...
Forum: a740g
Last Post: a740g
Yesterday, 04:43 AM
» Replies: 3
» Views: 458
|
_IIF limits two question...
Forum: General Discussion
Last Post: bplus
Yesterday, 02:56 AM
» Replies: 6
» Views: 117
|
DeflatePro
Forum: a740g
Last Post: a740g
Yesterday, 02:11 AM
» Replies: 2
» Views: 72
|
New QBJS Samples Site
Forum: QBJS, BAM, and Other BASICs
Last Post: dbox
12-20-2024, 06:16 PM
» Replies: 25
» Views: 902
|
Raspberry OS
Forum: Help Me!
Last Post: Jack
12-20-2024, 05:42 PM
» Replies: 7
» Views: 162
|
InForm-PE
Forum: a740g
Last Post: Kernelpanic
12-20-2024, 05:22 PM
» Replies: 80
» Views: 6,192
|
Merry Christmas Globes!
Forum: Programs
Last Post: SierraKen
12-20-2024, 03:46 AM
» Replies: 10
» Views: 151
|
|
|
The Width statement |
Posted by: eoredson - 04-05-2024, 04:43 AM - Forum: Help Me!
- Replies (15)
|
|
Since QB64pe has declared full functional QB45 compatible I have posted this snippet:
The QB45 contains Width with Device$
Code: (Select All) ' sample program to set Width statements.
Dim screenwidth As Integer
Dim screenheigth As Integer
Dim widthx As Integer
widthx = 80
screenwidth = 80
screenheight = 25
' reset file width
filenumber = FreeFile
Open "tempfile.xyz" For Output As #filenumber
Width #filenumber, widthx
' reset some printers
Width "lpt1:", widthx
Width "lpt2:", widthx
Width "lpt3:", widthx
' resets some drvies
Width "cons:", widthx
Width "scrn:", widthx
' reset lprint
Width LPrint widthx
' reset screen
'PRINT screenwidth, screenheight
Width screenwidth, screenheight
End
Where:
Code: (Select All) WIDTH Statement Details
Syntax
WIDTH [columns][,lines]
WIDTH {#filenumber | device},width
WIDTH LPRINT width
Both files and devices can be assigned an output-line width.
Syntax Description
WIDTH [columns][,lines] Sets the number of columns and lines to
display on the screen.
The value of columns must be either 40 or
80. The default value is 80.
The value of lines may be 25, 30, 43, 50,
or 60, depending on the display adapter
used and the screen mode (see the SCREEN
statement help topic for more information).
The number of lines displayed when the program
started will determine the default value.
WIDTH #filenumber,width Sets the line width of an output device opened
as a file (for example, LPT1: or CONS:).
The filenumber argument is the number
associated with the file in the OPEN
statement.
This form permits altering the width while
a file is open, since the statement takes
place immediately.
WIDTH device,width Sets the line width of device (a device file
name).
The device should be a string expression
(for example, "CONS:").
Note that this width assignment is deferred
until the next OPEN statement affecting the
device; the assignment does not affect output
for an already open file.
WIDTH LPRINT width Sets to width the line width of the line
printer, for use by subsequent LPRINT
statements.
|
|
|
Using color in Draw string |
Posted by: PhilOfPerth - 04-04-2024, 05:49 AM - Forum: Help Me!
- Replies (30)
|
|
How do I (or can I) nominate a colour for the string in this code?
Code: (Select All) WWidth = 1120: WHeight = 820: Mode = 32: Size = 24
Screen _NewImage(WWidth, WHeight, Mode)
SetFont: f& = _LoadFont("C:\WINDOWS\fonts\courbd.ttf", Size, "monospace"): _Font f&
lhs = (_DesktopWidth - WWidth) / 2
_ScreenMove lhs, 86 ' centre display on screen
CPL = WWidth / _PrintWidth("X")
PSet (500, 200): Draw "r100d100l100u100"
Sleep
I've tried adding C3 etc to the front, which is accepted but ignored, and C_rgb(...) which errors out.
|
|
|
For our Developers... |
Posted by: Pete - 04-03-2024, 10:40 PM - Forum: General Discussion
- Replies (16)
|
|
Ever consider adding _SAVE and _SAVEAS? I was thinking today (shut up Steve) that since someone changed the IDE save function to a more Windows type look, it might be fairly easy to code these nice features and add them to our keywords, much like the _InputBox feature.
I figure as long as we never lose our BASIC buildings blocks, to be able to build these functions from scratch, additions like this can't hurt the language and they might make the language more attractive to new users.
Oh, and as a side note, did you folks know the IDE cannot correctly save a program with certain control characters enclosed in quotes? Easy enough to work around that by making the string as CHR(0) + CHR$(1)... etc. Anyway, just thought I'd bring it up in case anyone has the time to look into it, after you're done poking fun at Steve's code while on Discord.
Pete
|
|
|
Screen size |
Posted by: emfril - 04-03-2024, 10:08 PM - Forum: Help Me!
- Replies (3)
|
|
I have written a program that reads the coastline coordinates of the continents and prints custom perspectives. I've been using SCREEN 12, which is 320x240 pixels:
https://emf.neocities.org/tmp/WestCiv.png
I would like to make the screen bigger, but if I use the _FULSCREEN command the image is distortedQ
https://emf.neocities.org/tmp/WestCiv2.png
I could of course change the code so that the full screen is not distorted. But I wonder: Is there a way to make it as big as possible but preserve the aspect ratio?
And, even better: can I specify the size of a (larger) screen in pixels? I would certainly like to increase the shight of the image to that of my screen and have a better resolution.
Thanks.
|
|
|
Arrays of record variables |
Posted by: Kernelpanic - 04-02-2024, 06:58 PM - Forum: General Discussion
- No Replies
|
|
I didn't find anything about arrays of record variables in the wiki. Here is an example of how to create such arrays.
The first representation is specified in the program, the second can be entered yourself.
Hm, is not a programm, so here.
Code: (Select All)
'Recordarrays. Uebergabe von Recordtype an Array - 1. April 2024
$Console:Only
Option _Explicit
Declare Sub Anzeigen(Motorrad As Any)
'Definition der Datenstruktur
Type MotorradModell
Modell As String * 30
Farbe As String * 10
Hubraum As String * 10
Kilowatt As String * 15
Fahrgewicht As String * 10
Preis As String * 12
End Type
'Array. Global zur Verfuegung stellen in diesem
'Fall nicht noetig.
Dim MotFeld(1 To 10) As MotorradModell
'Modell eingeben
MotFeld(1).Modell = "Honda 350 CB"
MotFeld(1).Farbe = "Rot-Weiss"
MotFeld(1).Hubraum = "350 ccm"
MotFeld(1).Kilowatt = "23 Kilowatt"
MotFeld(1).Fahrgewicht = "156 KG"
MotFeld(1).Preis = "2355.00 Euro"
Locate 2, 0
Print "Daten Selbst eingeben:"
Locate 3, 0
Input "Modell : ", MotFeld(2).Modell
Input "Farbe : ", MotFeld(2).Farbe
Input "Hubraum : ", MotFeld(2).Hubraum
Input "Kilowatt : ", MotFeld(2).Kilowatt
Input "Fahrgewicht: ", MotFeld(2).Fahrgewicht
Input "Preis : ", MotFeld(2).Preis
Cls 'Eingabe nicht stehen lassen
Locate CsrLin + 1, 0
'Uebergabe des Arrays von Recordvariablen, und anzeigen
Call Anzeigen(MotFeld(1))
'CsrLin ist noetig, da es sonst zu einer
'Ueberschneidung der Ausgabe kommt
Locate CsrLin + 2, 0
Call Anzeigen(MotFeld(2))
End 'Hauptprogramm
Sub Anzeigen (Motorrad As MotorradModell)
Print Tab(4); "Modell : ", Motorrad.Modell
Print Tab(4); "Farbe : ", Motorrad.Farbe
Print Tab(4); "Hubraum : ", Motorrad.Hubraum
Print Tab(4); "Kilowatt : ", Motorrad.Kilowatt
Print Tab(4); "Fahrgewicht: ", Motorrad.Fahrgewicht
Print Tab(4); "Preis : ", Motorrad.Preis
End Sub
|
|
|
|