Search found 1450 matches

by caseih
Jul 31, 2015 23:59
Forum: Libraries
Topic: Is GTK 3 dead for windows at 3.6
Replies: 4
Views: 2461

Re: Is GTK 3 dead for windows at 3.6

GTK+ was developed first on Unix and Linux, and to this day is still developed there primarily. It was originally an X11-based toolkit, with thin abstractions over the X11 parts, in the form of GDK. Over the years, this abstraction was developed more and made GTK+ more independent of the underlying ...
by caseih
Jul 27, 2015 16:00
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 14293

Re: Boolean Data Type in freebasic

Now that boolean support is in FBC, does FBC know how to mangle G++ symbols that use C++ bool types in their signature?
by caseih
Jul 27, 2015 15:59
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 14293

Re: Boolean Data Type in freebasic

Just curious but why do you have all the redundant logic in your AND_Gate sub? If you want to test Boolean why not do:

Code: Select all

Sub AND_Gate (In() As Boolean, ByRef res As Boolean)
    res = In(1) And In(2)
End Sub


or

Code: Select all

if In(1) AndAlso In(2) then res = true else res = false
by caseih
Jul 26, 2015 5:22
Forum: Community Discussion
Topic: Downside of using FreeBASIC
Replies: 17
Views: 2280

Re: Downside of using FreeBASIC

If the program is sufficiently interesting, and if the source code is available, then others could pick it up and maintain it if they chose, easily. However it's not enough that the source code is available somewhere. The author has to grant permission for others to use it after his death. This woul...
by caseih
Jul 26, 2015 5:12
Forum: General
Topic: Making compact number representation
Replies: 13
Views: 1197

Re: Making compact number representation

If you're going to store numbers in alternate bases using ascii letters as well as numbers as digits, then the resulting text isn't really human readable anyway. So why not just store them in binary? That's the most compact form you can get.
by caseih
Jul 22, 2015 14:54
Forum: Community Discussion
Topic: Version 1.03.0
Replies: 39
Views: 5048

Re: Version 1.03.0

Is GoRC.exe something that ships with fbc? What is GoRC.exe?
by caseih
Jul 22, 2015 14:48
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 14293

Re: Boolean Data Type in freebasic

Hello. I have first been surprised not to find boolean in fb. But after a short time I've noticed that if booleans were useful (for me for compatibility with vb.net which I use casually), it was however not necessary to add them as a part of the core language. They rather can be added (at different...
by caseih
Jul 22, 2015 3:57
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 14293

Re: Boolean Data Type in freebasic

I'm all for it! Now if you are intending this boolean to be workable with C++ classes, you'll have to adopt the same storage representation as C++ does, will you not (g++ usually)? Even worse, different C++ compilers represent bool differently. But FB can only handle g++ name mangling symbols, right...
by caseih
Jul 21, 2015 3:04
Forum: Linux
Topic: Linux Mint
Replies: 2
Views: 998

Re: Linux Mint

That's great you took the plunge! I find it a lot of fun, myself. Though you probably could have tried it in a VirtualBox virtual machine. But real hardware has advantages. Did you check the software installer app to see if it has allegro in there? In particular the -dev package? I took the liberty ...
by caseih
Jul 17, 2015 15:11
Forum: General
Topic: How Can I remove empty string In dynamic Array
Replies: 22
Views: 1307

Re: How Can I remove empty string In dynamic Array

The main difference between AND and ANDALSO in your case is that AND evaluates both sides of the expression before computing the result of the AND. ANDALSO short-circuits, meaning if the first part is false, it won't bother calculating the second part, and just returns false (0). The other differenc...
by caseih
Jul 16, 2015 14:45
Forum: General
Topic: FreeBasic to C++ problem
Replies: 6
Views: 477

Re: FreeBasic to C++ problem

Here's one that works with FB to make spaces instead of 0s: im as integer n n = 9 for j as integer = 1 to n for i as integer = n to 1 step -1 print chr(iif((i = j) or (i = n-j+1),48+i,32)); next i print next j sleep The equivalent C++ line: cout << ((char)((i == j) | (i == (n-j+1)) ? i+48 : 32)); Go...
by caseih
Jul 16, 2015 4:34
Forum: General
Topic: FreeBasic to C++ problem
Replies: 6
Views: 477

Re: FreeBasic to C++ problem

In C++ you would use the ternary operator:

Code: Select all

cout << ( (i == j) || (i == (n -j+1) ? i : ' ');


in FreeBASIC you would do:

Code: Select all

print IIF( i=j or i =n-j+1, i, "   ")


EDIT: scratch that, not sure either example works because the types are different
by caseih
Jul 16, 2015 2:54
Forum: General
Topic: FreeBasic to C++ problem
Replies: 6
Views: 477

Re: FreeBasic to C++ problem

Just a quick thought... in your FreeBASIC code, it would be faster to multiply by negative i than it would be to call ABS() on the boolean expression and then multiply by i:

Code: Select all

print (i = j)*-i or (i = n-j+1)*-i
by caseih
Jul 16, 2015 2:15
Forum: General
Topic: FreeBasic to C++ problem
Replies: 6
Views: 477

Re: FreeBasic to C++ problem

EDIT: I first got a few things wrong, so I've gone back through and corrected my post. Freebasic actually does not have logical operators. They are all bitwise. You have replaced a bitwise OR with a logical ||, which only returns true or false (casts to 1 or 0). Your FB expression returns whichever ...
by caseih
Jul 13, 2015 2:15
Forum: Beginners
Topic: Converting old code
Replies: 18
Views: 2116

Re: Converting old code

Not sure if this is applicable or not but be aware that if you have user-defined type called "record" and also a string called "record" then len(record) will give you the length of the type, not the length of the string. I think the latest version of the compiler kicks out a warn...

Go to advanced search