Search found 5165 matches

by counting_pine
Sep 19, 2017 11:52
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 18
Views: 536

Re: Pure FB Runtime Library (in progress)

The asm code was possibly more relevant when we only had a 'gas' emitter. (Thankfully FB has fewer gas emissions now :) Now seems like a good time to remove the assembly. We could always re-add it at a later date if need be. Edit: actually, given it's used specifically within the rtlib, I don't thin...
by counting_pine
Sep 18, 2017 14:32
Forum: Projects
Topic: Pure FB Runtime Library (in progress)
Replies: 18
Views: 536

Re: Pure FB Runtime Library (in progress)

Do we have provisioning yet for including bas files when compiling the rtlib?
I wouldn't have thought it would be too hard, but feels like an important first step.
by counting_pine
Sep 12, 2017 11:56
Forum: Beginners
Topic: "Locate" wrong position
Replies: 6
Views: 243

Re: "Locate" wrong position

Could someone post a bug report?
Is this in Linux or Windows/elsewhere? (I'm guessing the former.)
(Are you any relation to badidea, by any chance?)
by counting_pine
Sep 12, 2017 11:39
Forum: General
Topic: Sha-256 QB
Replies: 15
Views: 372

Re: Sha-256 QB

By the way, converting an "unsigned" Integer to Long is easier than shown there - you just take 'x AND 65535'.
But it only works because a 32-bit signed Long (31 bits when positive) can easily hold a 16-bit signed Integer.
by counting_pine
Sep 12, 2017 11:31
Forum: General
Topic: Sha-256 QB
Replies: 15
Views: 372

Re: Sha-256 QB

The ULONG32& function does not change the variable, because 'x < &h80000000' (i.e. 'x < -2147483648') is always false. Even if it did work, the return type ('&' = Long) is signed, so it won't store the full range of unsigned values. You would need to use a Double to store the value exact...
by counting_pine
Sep 11, 2017 11:34
Forum: General
Topic: Sha-256 QB
Replies: 15
Views: 372

Re: Sha-256 QB

Interesting.. Is this pure QBasic? I don't think that supported Option Explicit. I guess probably the variables are all implicitly Single, which is 24-bit precision max. You could make them all Long (DEFLNG A-Z). That is 32-bit, but you will probably still have problems, because: - Long is signed, a...
by counting_pine
Sep 10, 2017 12:04
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Re: Iif compile-time return value

I won't go any further into the RTTI discussion. I didn't implement it, and I'm not an expert in it. I don't have a problem, in principle, with IIF and constants. I do have a problem with inconsistent behaviour. From my perspective, the only purpose of a warning would be to say: sorry, the compiler ...
by counting_pine
Sep 09, 2017 22:24
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Re: Iif compile-time return value

I'm not an expert on RTTI, but that looks like a bug, or at least a badly worded error: "types have no hierarchical relation". Clearly c's type is a child of Parent. I'd call that a hierarchical relation. I've posted a bug report about IIF ( 863 ). Perhaps the 'c Is Parent' error warrants ...
by counting_pine
Sep 09, 2017 17:02
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Re: Iif compile-time return value

We don't want an error if it's resolvable at compile-time! We just want it to behave the same as if it wasn't resolvable.
by counting_pine
Sep 09, 2017 15:19
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Re: Iif compile-time return value

FB will treat Lvalues differently from Rvalues in byref expressions. function clobberme(byref n as integer) as integer function = n*n n = 0 end function dim as integer a = any, n = 42 print n print clobberme( iif(a = a, n, n) ) print n The effect of this code depends on whether fbc changes 'a = a' i...
by counting_pine
Sep 09, 2017 15:16
Forum: Community Discussion
Topic: Question about rtlib
Replies: 13
Views: 437

Re: Question about rtlib

It might be good to use FB to augment the runtime library, even if not completely rewrite it. A couple of advantages I can think of: - code would be easier for the FB community to read and change/add to. - we could provide access to object-orientated code, or even just code in namespaces without hav...
by counting_pine
Sep 09, 2017 14:37
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Re: Iif compile-time return value

It would probably be better to write a bug report about it than document it.
I presume it will also cause changes in behaviour if such an expression is passed as a Byref parameter. We don't really want that to happen.
by counting_pine
Sep 09, 2017 13:13
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Re: Iif compile-time return value

From the example you've posted, it sounds like you're saying: when the condition is constant, iif may return an Lvalue. I think this is one of those cases where the behaviour of the compiler should be challenged rather than documented. I am generally wary of any difference in behaviour that depends ...
by counting_pine
Sep 09, 2017 11:19
Forum: Documentation
Topic: Iif compile-time return value
Replies: 15
Views: 339

Iif compile-time return value

https://freebasic.net/wiki/KeyPgIif/history IIf returns a different numeric or string or UDT value (not a reference) depending of the result of a conditional expression. Its typical use is in the middle of an expression; it avoids splitting it to put a conditional in the middle. In the particular c...
by counting_pine
Aug 28, 2017 14:21
Forum: Tips and Tricks
Topic: `git dirs' custom command to get git status for multiple directories recursively
Replies: 2
Views: 220

Re: `git dirs' custom command to get git status for multiple directories recursively

Pretty cool. It works well for me on Linux.
With '--status', it does show this message on some repos: fatal: no upstream configured for branch 'master'
Which I imagine is just a slightly less polite way of saying the master branch doesn't have a remote it can be pushed to.

Go to advanced search