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,324
Full Statistics
|
Latest Threads |
GNU C++ Compiler error
Forum: Help Me!
Last Post: eoredson
10 minutes ago
» Replies: 4
» Views: 111
|
What do you guys like to ...
Forum: General Discussion
Last Post: Pete
6 hours ago
» Replies: 7
» Views: 79
|
Mean user base makes Stev...
Forum: General Discussion
Last Post: Pete
6 hours ago
» Replies: 8
» Views: 211
|
Fast QB64 base64 encoder ...
Forum: a740g
Last Post: a740g
Yesterday, 04:43 AM
» Replies: 3
» Views: 453
|
_IIF limits two question...
Forum: General Discussion
Last Post: bplus
Yesterday, 02:56 AM
» Replies: 6
» Views: 115
|
DeflatePro
Forum: a740g
Last Post: a740g
Yesterday, 02:11 AM
» Replies: 2
» Views: 69
|
New QBJS Samples Site
Forum: QBJS, BAM, and Other BASICs
Last Post: dbox
12-20-2024, 06:16 PM
» Replies: 25
» Views: 901
|
Raspberry OS
Forum: Help Me!
Last Post: Jack
12-20-2024, 05:42 PM
» Replies: 7
» Views: 157
|
InForm-PE
Forum: a740g
Last Post: Kernelpanic
12-20-2024, 05:22 PM
» Replies: 80
» Views: 6,184
|
Merry Christmas Globes!
Forum: Programs
Last Post: SierraKen
12-20-2024, 03:46 AM
» Replies: 10
» Views: 148
|
|
|
About dialog box call |
Posted by: eoredson - 05-07-2024, 02:50 AM - Forum: Help Me!
- Replies (4)
|
|
For some time now I have been using the following for dialog box calls from the .DLL MSDN library:
Code: (Select All) ' dialog box
If VarX = -1 Then
Result = GetOpenFileNameA&&(OpenCall) ' Do Open File dialog call.
End If
If VarX = -2 Then
Result = GetSaveFileNameA&&(OpenCall) ' Do Save File dialog call.
End If
Although I was unaware they are supported within QB64 as such:
Code: (Select All) Midi$ = _OpenFileDialog$("Open File", "", "*.mid ", "Midi files", 0)
If _MessageBox("MidiPlay", "Load: " + Midi$, "yesno", "question") = 0 Then Color 7: End
_MessageBox "MidiPlay", "Press <enter> to quit: ", "info"
My real question is if the box call can return filenames, how do I get a name of a folder instead!?
Thanks, Erik.
|
|
|
Extended KotD #1: _ANDALSO |
Posted by: SMcNeill - 05-05-2024, 09:20 PM - Forum: Keyword of the Day!
- Replies (4)
|
|
You guys may have noticed that we haven't had any Keyword's of the Day for ages now. The reason for this is really rather simple -- we basically covered the vast majority of keywords and ran out of topics to cover!
Fortunately, as QB64PE progresses, new commands and functionality gets added over time, and now that we're up to version 3.13, it's probably about time to take a few moments and start going into better detail about what these new functions are, why they were added, and what a person might use them for. To facilitate this, I'm just going to start at version 3.13 and work my way backwards, down to version 3.0 or so, and try and highlight one function per day, until I've basically covered them all for us.
For today's entry, let's talk about the newest LOGICAL OPERATOR -- _ANDALSO.
First, a little code to discuss:
Code: (Select All)
a = 1
b = 2
If a And b Then Print "A AND B are TRUE" Else Print "A AND B are FALSE"
If a _Andalso b Then Print "A _ANDALSO B are TRUE" Else Print "A _ANDALSO B are FALSE"
Now, as all you folks probably know, AND is a bitwise comparision tool, that compares bits between two values. It is NOT a logical comparision tool to determine if TRUE or FALSE exists.
1 AND 2 <--- both of these values are non-zero, so in QBASIC, their values are considered to be TRUE. Now, TRUE and TRUE should logically be TRUE. Right?
WRONG!!
As I mentioned before, these are NOT logical comparisons!
00000001 <--- 1, as written in binary
00000010 <--- 2, as written in binary
------------ <--- AND -- let's compare and AND the bits here
00000000 <--- the return value is 0 -- it's FALSE!
1 AND 2 = 0... It's FALSE!
So what's the solution here, if we don't want to deal with binary comparisons? The old method was to compare both against 0, as such:
Code: (Select All)
If 1 <> 0 And 2 <> 0 Then Print "It's TRUE"
IF the first value is not zero, AND the second value is not zero, then it's TRUE... This is how we always used to have to create logical comparisons, instead of just allowing for bitwise AND to mess things up by itself.
But now, we have a new logical operator: _ANDALSO
If 1 _ANDALSO 2 THEN PRINT "It's TRUE"
This basically does what the previous example does for us -- it compares both values against 0 to see if they're true, and if they're both true, then it assigns the end result as being true.
This is NOT bit-comparision -- use AND for that. _ANDALSO is simply logical comparison.
IF Happy _ANDALSO Sexy Then Life = Good
_ANDALSO -- logical comparison of two values (are they TRUE/non-zero, or FALSE/zero). They're that simple to understand and use.
https://qb64phoenix.com/qb64wiki/index.php/ANDALSO
|
|
|
Options menu Compiler Settings |
Posted by: TerryRitchie - 05-04-2024, 05:23 PM - Forum: General Discussion
- Replies (5)
|
|
I'm currently finishing up a rather large side lesson in the tutorial on getting the most from the QB64 IDE.
Would someone like to explain to me the various compiler settings options found in the options menu?
I have a general idea of what they are used for but I would appreciate if a developer could chime and and give a detailed description of each option and how using that option would be beneficial along with a use case scenario.
I want to make sure that the information in the tutorial is accurate.
|
|
|
I need help |
Posted by: BloodyHash - 05-03-2024, 10:51 AM - Forum: Help Me!
- Replies (2)
|
|
so let's say i wanna make a gw_basic dungeon crawler does anyone has a template for the codes?
|
|
|
DIM - AS - VARIABLE TYPE likely bug |
Posted by: bartok - 05-03-2024, 06:59 AM - Forum: Help Me!
- Replies (25)
|
|
I have found a probable bug using AS.
Writing, for example:
DIM A%
it's the same then writing
DIM A AS INTEGER
But it is possible to write:
DIM A%
DIM A$
but we incur into a "Name already in use" error if we write:
DIM A AS INTEGER
DIM A AS STRING
Example:
Code: (Select All)
OPTION _EXPLICIT
DIM A$
DIM A% '--------------------------> working
'DIM A AS STRING
'DIM A AS INTEGER' ---------------------> not working
A$ = "hello"
A% = 2
PRINT A$, A%
|
|
|
Question about Find in Search |
Posted by: TerryRitchie - 05-02-2024, 03:27 PM - Forum: General Discussion
- Replies (3)
|
|
When you select find in the search menu an input box dialog appears. One of the options you can select is:
[ ] Whole Word
What exactly does this option do? I've been playing around with having it checked and unchecked but I see no difference. What am I missing?
|
|
|
|