Search found 3264 matches

by MrSwiss
Jul 26, 2015 15:07
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1152

Re: Ubyte and negative step in 'For' loop [Solved]

Just to get a confirmation I would have an other question around this. I'm on 32 bits system, if I use integers in my code file that would imply a smaller integer type than on a 64 system and code source doesn't keep same meaning. But if I provide the executable, is it ensured that the integer repr...
by MrSwiss
Jul 25, 2015 23:25
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 13104

Re: Boolean Data Type in freebasic

We could produce an error and prevent user from ever writing code that tries to add two booleans together. Yes I'd agree with you, that booleans can NOT be used as other data types can (+ - / *), only logical operators should be allowed, as well as the =[TRUE|FALSE] operator. This simply because th...
by MrSwiss
Jul 25, 2015 22:22
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 13104

Re: Boolean Data Type in freebasic

For "1+1" (in the context of boolean) we are actually meaning "TRUE+TRUE". Does that make any sense? Probably not. And if we need overloaded operators to get the desired behaviour, then we are dealing with something that is not exactly like an integer. fbc allows "TRUE"...
by MrSwiss
Jul 25, 2015 21:46
Forum: General
Topic: Problems with Input!
Replies: 1
Views: 210

Re: Problems with Input!

#Lang "fblite" #include "fbgfx.bi" dim as string test test=" " do 'this is where you press like WASD to move and stuff. Pressing tab will open the 'console input'. if multikey(sc_tab) then while InKey() wend ' empty Keyb.-Buffer input test: EndIf ''' goto printTest <--...
by MrSwiss
Jul 25, 2015 21:09
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1152

Re: Ubyte and negative step in 'For' loop [Solved]

Tourist Trap wrote: at least for integer types MrSwiss wrote: This would in effect screw up the existing logic totaly! Tourist Trap wrote: It would only change the logic for integer types if you read me precisely. You really seem to be slow ... there is only one logic for all Types! Otherwise you'd...
by MrSwiss
Jul 25, 2015 20:37
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1152

Re: Ubyte not compatible with negative step in For loop?

I think that at each loop, the comparision is executed after the decrementation. With an Ubyte, the test 'index < 0' will be never verified. Possible yes. But at least for integer types including the limit would be more useful. If index <= 0 then exit. NEVER in a lifetime ... This would in effect s...
by MrSwiss
Jul 25, 2015 20:24
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1152

Re: Ubyte not compatible with negative step in For loop?

why the for loop misses the detection over the index variable, that's what I cant figure out. Simply because the next expected value would be -1 (which an UByte can't represent). You are getting 255 which, on a UByte, is correct, but: it is of course > 0 (you'll never get the condition < 0 to evalu...
by MrSwiss
Jul 25, 2015 19:49
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1152

Re: Ubyte not compatible with negative step in For loop?

The incrementor/decrementor variable in the loop has to be the same Type as the Step variable!

Code: Select all

' Single/Single
For i As Single = 1 To 2 Step 0.001
    ' ... code here
Next
by MrSwiss
Jul 25, 2015 19:15
Forum: Beginners
Topic: Ubyte and negative step in 'For' loop [Solved]
Replies: 21
Views: 1152

Re: Ubyte not compatible with negative step in For loop?

Please, do anyone know what the reason for this Short answer: logic says its wrong, to use an unsigned Type variable to compare with a negative (Step) value (signed). In more detail: I suppose the compiler makes a TypeOf() check, to see whether all parameters are of a compatible Type. This would th...
by MrSwiss
Jul 24, 2015 18:51
Forum: Beginners
Topic: money format
Replies: 12
Views: 1169

Re: money format

Sooner or later in your IT career you will be in a situation where you bill your customers, and then you'll have to deal with accountants. Accountants are strange folk, and they can really be obsessed endlessly about a discrepancy of a few cents in their balances. Worse, they can ruin your perfectl...
by MrSwiss
Jul 24, 2015 17:37
Forum: Community Discussion
Topic: Version 1.03.0
Replies: 39
Views: 4840

Re: Version 1.03.0

With the win64 version I'm having a problem with the linker. Linking fails with ld.exe: skipping incompatible C:\FreeBasic-1.03.0-win64\lib\win64/libxfont.a when searching for -lxfont ld.exe: skipping incompatible C:\FreeBasic-1.03.0-win64\lib\win64\libxfont.a when searching for -lxfont ld.exe: ski...
by MrSwiss
Jul 24, 2015 14:49
Forum: Beginners
Topic: money format
Replies: 12
Views: 1169

Re: money format

Questions about Bankers from sb named "MrSwiss" ? :-) Well, as you might know: not everybody in Holland/Netherlands is able to make "Edammer Cheese", grow Flowers etc. The same applies to Switzerland ... :-D we have, apart from Banks/Bankers: Insurances, Industry, Pharma, Chocco...
by MrSwiss
Jul 24, 2015 14:09
Forum: Beginners
Topic: money format
Replies: 12
Views: 1169

Re: money format

dodicat wrote:The C function will use banker's rounding.

What exactly does that mean? A new sinister way to rip us all off?
(That's what bankers usually do, all day long ;-) , except of course, earning far too much money.)
by MrSwiss
Jul 24, 2015 13:39
Forum: Community Discussion
Topic: Version 1.03.0
Replies: 39
Views: 4840

Re: Version 1.03.0

@MOD,
thanks a lot for 'fixing' this issue (have it fixed by the 'culprits') ;-) . Tested and working now again as expected!
by MrSwiss
Jul 24, 2015 11:38
Forum: Community Discussion
Topic: Boolean Data Type in freebasic
Replies: 121
Views: 13104

Re: Boolean Data Type in freebasic

Hi all, I've just uploaded my latest project, which makes use of Long's 'misused' as BOOLEANS. See: http://freebasic.net/forum/viewtopic.php?f=8&t=23791 It would definitely be simpler to read if there was a BOOLEAN Type present ... Instead of: bi(n) = 1 just as: bi(n) = TRUE

Go to advanced search