Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

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.

Print this item

  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

Print this item

  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.

Print this item

  Just for our Star Wars fans...
Posted by: johnno56 - 05-04-2024, 12:31 PM - Forum: General Discussion - Replies (3)

May the forth be with you.

Happy will you be, yes...

Print this item

  Value system
Posted by: BloodyHash - 05-04-2024, 05:23 AM - Forum: Help Me! - Replies (1)

so guys im making a text adventure of a boy who wanna be no 1 pimp
i added the option for him to study, get a job or go to fitness system
now all 3 of these option i wanna add a value 
Job = money value
Study = Inteligence value
Gym = Strength value

how can i add those stuff Big Grin

Print this item

  What is Quick Navigation?
Posted by: TerryRitchie - 05-03-2024, 06:55 PM - Forum: General Discussion - Replies (6)

What is "Quick Navigation" in the IDE Search menu and how do you use it?

I'm surprised at how many of the IDE features I never use even though they have been there for years.

Print this item

  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?

Print this item

  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%

Print this item

  Trivia Lists
Posted by: SMcNeill - 05-02-2024, 05:35 PM - Forum: General Discussion - Replies (10)

At some time in the past, I was going to have fun and write a program that created a Jeopardy type game to play around with.  Towards that goal, I surfed the net and collected various trivia questions from all over the place.   Since I never got around to making that game, I thought I'd go ahead and share these lists here in case anyone else would be interested in them.

5 lists in the 7z archive here
.7z   Trivia.7z (Size: 1.24 MB / Downloads: 47)

All in CSV format.   Feel free to use them as you wish; as far as I know, these are all common facts and public domain.  You might need to sort through them a bit to find exactly what you're looking for, but at least it's a place to start looking from, to perhaps get someone started on a nice triva app/game.  Smile

Print this item

  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?

Print this item