Welcome, Guest |
You have to register before you can post on our site.
|
Latest Threads |
The QB64 IDE shell
Forum: Utilities
Last Post: JasonPag
09-16-2024, 05:37 PM
» Replies: 9
» Views: 762
|
Importance regarding Ches...
Forum: Utilities
Last Post: JasonPag
09-01-2024, 06:34 PM
» Replies: 0
» Views: 31
|
Chess and Analysis and En...
Forum: Utilities
Last Post: JasonPag
08-28-2024, 02:37 PM
» Replies: 0
» Views: 32
|
DAY 009:_PutImage
Forum: Keyword of the Day!
Last Post: grymmjack
09-02-2023, 02:57 PM
» Replies: 54
» Views: 2,033
|
Fall Banner Contest?
Forum: Site Suggestions
Last Post: grymmjack
08-31-2023, 11:50 PM
» Replies: 36
» Views: 1,261
|
ColorPicker - Function th...
Forum: Dav
Last Post: Dav
08-31-2023, 11:04 PM
» Replies: 3
» Views: 315
|
Goals(1) = New Tile()
Forum: Works in Progress
Last Post: RhoSigma
08-31-2023, 09:45 PM
» Replies: 3
» Views: 127
|
micro(A)v11
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:14 PM
» Replies: 90
» Views: 3,589
|
Updating The Single Most ...
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:13 PM
» Replies: 7
» Views: 254
|
QBJS Image Question
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 05:49 PM
» Replies: 5
» Views: 155
|
|
|
Slight problem with calculation of number of lines of text that can be displayed |
Posted by: hanness - 05-06-2022, 10:06 PM - Forum: General Discussion
- Replies (2)
|
|
I'm so close to having everything working - just a few tiny odds and ends to figure out....
Let's say I open a Windows a screen with QB64 that is 400 x 400 pixels and I start displaying text on the screen with a font size of 12. My calculations say that I should be able to fit 33 lines of text on this screen (33 x 12 pixels = 396 pixels). However, in actuality, I can only fit 32 lines.
Is there something like an invisible "buffer" of a few pixels that cannot be used?
When I use a screen capture utility to capture a copy of my window, I can see that the area inside of the physical screen borders is precisely 400 pixels so I can't quite make sense of what I'm running into.
|
|
|
SOLVED: need help running code from Notepad++ with the NppExec plugin |
Posted by: madscijr - 05-06-2022, 03:04 PM - Forum: Help Me!
- Replies (2)
|
|
Hey everyone.
A while ago I asked about setting up Notepad++ to compile/debug QB64 code, and TempodiBasic graciously provided some instructions which I finally got around to trying out, only it's not (fully) working.
I'm running Windows 10 Pro with QB64 2.0.2, and Notepad++ which self-updated to v8.3.3 today and works fine.
Per the instructions, I installed the NppExec plugin, and added the QB64 folder to the system path, and rebooted.
I have a "hello world" program in my qb64 folder, e.g. - C:\Users\{username}\Documents\Code\qb64\programs\hello1.bas
which is opened in Notepad++.
I went in the Plugin menu and selected NPPExec, and configured it per the instructions
checking the options Show NppExec Console, Console Command History and Follow $(CURRENT_DIRECTORY).
Then with my program open in the editor, I pressed F6 for "Execute NppExec Script..."
and a command window opened.
I typed the command:
Code: (Select All) QB64.EXE -c "$(FULL_CURRENT_PATH)" -o "$(FULL_CURRENT_PATH)"
NPP_RUN $(CURRENT_DIRECTORY) && $(NAME_PART) && ".exe"
and saved it, and clicked OK.
A DOS window opens and it looks like QB64 is compiling my code
(so far so good) and then Windows opens the \qb64\programs\ folder in Explorer,
and I can see my program now has an EXE file created with the current date/time.
In Notepad++, the NppExec console has:
QB64.EXE -c "C:\Users\{username}\Documents\Code\qb64\programs\hello1.bas" -o "C:\Users\{username}\Documents\Code\qb64\programs\hello1.bas"
Process started (PID=8892) >>>
<<< Process finished (PID=8892). (Exit code 0)
NPP_RUN: C:\Users\{username}\Documents\Code\qb64\programs && hello1 && ".exe"
================ READY ================
The problem is the EXE is compiled but not being run (I have to double-click on it to actually execute it, and it does work).
Is there anything I should change or add to the F6 command to make NppExec actually run the code once it's compiled?
I checked my Windows Security & antivirus and am not seeing any warnings or anything, so I don't think that's the issue.
Any help much appreciated...
|
|
|
Boolean Algebra |
Posted by: TarotRedhand - 05-06-2022, 11:44 AM - Forum: Learning Resources and Archives
- Replies (11)
|
|
Some years ago I wrote a tutorial on this topic for the scripting community of Neverwinter Nights. I have now gone through this and edited it to make it relevant for QB64. As I am new to QB64, I would appreciate it if someone will download it, read it and let me know of any errors that they come across no matter how small. The package contains 2 pdf documents (the readme and the 20 page tutorial), an HTML cheat sheet and a plain text document of pre-calculated constants.
Dropbox Link removed - Download link to newer, more accurate version on page 2 of this thread.
All comments welcome.
Thanks.
TR
|
|
|
image unroller |
Posted by: James D Jarvis - 05-05-2022, 09:26 PM - Forum: Programs
- Replies (3)
|
|
A simple little image unroller that does an image reveal like a scroll being unrolled. Someone posted an example in a facebook group in their dialect of basic asking if other forms of basic could handle it. So I whipped this up.
Code: (Select All) ' Picture unroller
img& = _LoadImage("hexmap0001.jpg", 32) 'your image here
w = _Width(img&)
h = _Height(img&)
sc& = _NewImage(w, h, 32)
Screen sc&
Cls: s = 3
For yc = 0 To h Step s:
_Limit 30
_PutImage (0, 0), img&, sc&, (0, 0)-(w, yc)
_PutImage (0, yc - 6)-(w, yc + 6), img&, sc&, (0, yc)-(w, yc + 3)
Next yc
|
|
|
How can I read characters from the screen? |
Posted by: hanness - 05-05-2022, 09:16 PM - Forum: General Discussion
- Replies (4)
|
|
Assume that I am initializing my display like this:
_FullScreen _Off , _Smooth
_FreeImage oldimage&
Font& = _LoadFont(FontPath$, FontSize, "MONOSPACE")
_Font Font&
Now I write a bunch of text to the screen.
Later, I want to read the character at the upper left of the screen. I tried to do this like this:
print screen(1,1)
or
MyVar$ = CHR$(screen(1,1))
However, I'm getting an illegal function call when the line with screen(1,1) is executed.
Is this only valid with screen mode 0 or am I missing something here?
If this cannot be made to work, is there any other way to read characters from the screen?
|
|
|
List of QB64 Constants? |
Posted by: dcromley - 05-05-2022, 04:49 PM - Forum: Help Me!
- Replies (5)
|
|
Is there a list of QB64 constants, like _PI=3.14..?
Also, 1/0 gives INF and -1/0 gives -INF. Are there INF and -INF constants?
This code is just some experimenting (some garbage in the 2nd line of output - no problem).
Code: (Select All) DefLng I
DefSng F
On Error GoTo zerr
Print _Pi
fhi = 1 / 0
flo = -1 / 0
Print "div by 0 - float:", fhi; flo
ihi = 1 / 0
ilo = -1 / 0
Print "div by 0 - long integer:", ihi, ilo
Print "Sqr(-1)= "; Sqr(-1)
zerr:
Print Chr$(13) + "Err"; Err; "in line"; _ErrorLine
End
|
|
|
|