Search found 3171 matches

by MrSwiss
Jul 28, 2019 21:09
Forum: Hardware Interfaces / Communication
Topic: FreeBasic communication with Arduino logic error?
Replies: 50
Views: 5156

Re: FreeBasic communication with Arduino logic error?

hmmm, move the String buttons; (declaration) into void loop(){.
Use it as parameter in readButtons(String buttons){ and also in the call:
Serial.println(readButtons(buttons)); then check, if it makes a
difference.
by MrSwiss
Jul 28, 2019 19:23
Forum: Hardware Interfaces / Communication
Topic: FreeBasic communication with Arduino logic error?
Replies: 50
Views: 5156

Re: FreeBasic communication with Arduino logic error?

I've not checked the FB code ... Arduino code (reviewed, adapted): int serialData = 0; void setup(){ pinMode(22,INPUT); // button switches pinMode(23,INPUT); pinMode(24,INPUT); pinMode(25,INPUT); pinMode(30,OUTPUT); // output to LEDS pinMode(31,OUTPUT); pinMode(32,OUTPUT); pinMode(33,OUTPUT); Serial...
by MrSwiss
Jul 27, 2019 23:44
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7599

Re: StringArray Sort (case independent)

While 64 bit only is acceptable but, 32 bit only is totally inacceptable ...
Preferable is anyway: both!
That's why we're using FB and not "lower level languages" after all! ;-)
by MrSwiss
Jul 27, 2019 17:49
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7599

Re: StringArray Sort (case independent)

fxm wrote:Have you really tested it?
No, just NOT interrested ...
I'm only keeping unique entry's, as already stated!
(that code was omitted, to keep close to the stated case)

What I'm interrested in, is: No own, 'original' ideas?
by MrSwiss
Jul 27, 2019 17:28
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7599

Re: StringArray Sort (case independent)

in case of string duplication but with different cases: Sorry, not useful IMO, because: - only for use, if 2 differing occurences (not triplicates, or larger multiples) - I'm usually after sorting, killing all multiple occurences, anyway ... (the pick of case can be influenced, by positioning in ar...
by MrSwiss
Jul 27, 2019 16:48
Forum: General
Topic: No warning if a select case as const value are out of range compiler crash !
Replies: 12
Views: 1524

Re: No warning if a select case as const value are out of range compiler crash !

Compile with -exx switch, to check for: array access 'out of range' errors.
Or any one of those freshly added, special "checking options". (ver. 1.07.0 dev)
by MrSwiss
Jul 27, 2019 15:56
Forum: General
Topic: No warning if a select case as const value are out of range compiler crash !
Replies: 12
Views: 1524

Re: A bug with select case as const (interleaved)

Not certain, whether this is really a bug. There are limitations to: Select Case As Const (as described in FB's docs). If As Const is used, only integer constants (all numeric constants excluding the two floating-point constants: single and double) can be evaluated and the expression list supports s...
by MrSwiss
Jul 26, 2019 22:34
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7599

Re: StringArray Sort (case independent)

Jep, dodicat got it, again! Here comes my implementation, a bit more code, but no "crt.bi", because Q_Sort() is implemented too. All I'm doing is: wrap Q_Sort() within another Sub Q_SortUniStr(), which does the pre-/post- processing, before and after Q_Sort(), with temp. string array: ' Q_...
by MrSwiss
Jul 26, 2019 17:46
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7599

Re: StringArray Sort (case independent)

dodicat wrote:Let DOS take the strain?

Nice idea, but not what I've intended (make QuickSort return correctly).
There is no need for file I/O ... can be done in memory alone.
My intention is: to get those 'coders brains' up to speed, once in a while.
by MrSwiss
Jul 26, 2019 15:54
Forum: Tips and Tricks
Topic: StringArray Sort (case independent)
Replies: 87
Views: 7599

StringArray Sort (case independent)

It seems, that in many cases of sorting a StringArray, the case's inside the individual Strings, are simply ignored, e.g. QuickSort ... (this leads to: incorrect sort result!). Example: "NOT" comes before "No" (it should be vice versa, from a human perspective) (From a strictly n...
by MrSwiss
Jul 25, 2019 15:53
Forum: General
Topic: Replace string throughout code
Replies: 7
Views: 1019

Re: Replace string throughout code

I want to understand macros so that I can use their features. This will at least save me some typing while learning some new method. Don't do that, while still at the very beginning. Learn the FB language/syntax first. FB-Manual: here ... Reason: your "short-cut" coding, becomes less and ...
by MrSwiss
Jul 25, 2019 15:29
Forum: General
Topic: Replace string throughout code
Replies: 7
Views: 1019

Re: Replace string throughout code

First and foremost: int (from C language) is NOT Integer in FB, but Long.
Since both are: 32 bit fixed size signed, integer-data-type.
rnbas wrote:I want to have a string replaced throughout my code during compilation process:

Code: Select all

Type int As Long
Should do the trick. ;-)
by MrSwiss
Jul 24, 2019 14:48
Forum: Beginners
Topic: One function for all types of data?
Replies: 6
Views: 908

Re: One function for all types of data?

rnbas wrote:One will not miss that this function is overloaded.
Btw. this applies to Sub's too, as well as Operators (by default, in UDT's).
by MrSwiss
Jul 24, 2019 14:27
Forum: Documentation
Topic: Is the docu about variadic argument in #define or #macro complete ?
Replies: 7
Views: 916

Re: Is the docu about variadic argument in #define or #macro complete ?

fxm,
please, don't use "discriminate" (it carries a very bad notion: to discriminate somebody)
rather: differentiate (thx).
by MrSwiss
Jul 24, 2019 13:24
Forum: Beginners
Topic: One function for all types of data?
Replies: 6
Views: 908

Re: One function for all types of data?

rnbas wrote:Should we omit "overload" keyword with first function in file or last function?
For readabilty purposes, I'm writing 'overload' in every implementation,
as well as the declarations.

Go to advanced search