Search found 2857 matches

by MrSwiss
Jan 24, 2019 2:32
Forum: General
Topic: @CODERS "Endian stuff"
Replies: 9
Views: 192

Re: @CODERS "Endian stuff"

@albert,
albert wrote:Now how do you convert the byte swapped value (little endian) back to big endian ????
Well, the same way:
Swap CPtr(UByte Ptr, @UShort)[0], CPtr(UByte Ptr, @UShort)[1]
@UShort = address of a UShort variable (UShort Ptr)
by MrSwiss
Jan 24, 2019 1:38
Forum: General
Topic: @CODERS "Endian stuff"
Replies: 9
Views: 192

Re: @CODERS "Endian stuff"

So now i can get: The actual "00" to "99" value of the ushort ptr.. The the byte swapped value of the ushort ptr.. I don't really understand because, value of a UShort = 0 To 65535 ... ??? (dereferenced UShort Ptr, is the same) value of a UByte = 0 To 255 ... ??? (dereferenced U...
by MrSwiss
Jan 23, 2019 23:24
Forum: General
Topic: @CODERS "Endian stuff"
Replies: 9
Views: 192

Re: @CODERS "Endian stuff"

I was talking about forcing a ptr to return a certain endian A ptr has always the same "endianness", as the machine's CPU. Maybe you'll understand it better in code (than in words). Two overloaded endian switchers (32bit / 64bit integers): ' (c) 2019-01-24, MrSwiss Function sw_endian Over...
by MrSwiss
Jan 18, 2019 15:06
Forum: General
Topic: 2d quasi cristals
Replies: 3
Views: 119

Re: 2d quasi cristals

At a quick first glance, I'd change the following two Functions: function length( x as double , y as double ) as double return sqr( x * x + y * y ) ' <-- for speed (simpler math.) end Function function irange( low as integer , high as integer ) as integer return int( rnd() * ( (high + 1) - low ) + l...
by MrSwiss
Jan 17, 2019 15:28
Forum: Beginners
Topic: DIR does list (some) files as directories
Replies: 14
Views: 270

Re: DIR does list (some) files as directories

padawan wrote:Same command but different problem.

Well, I consider that remark, as rather short-sighted.
(It could very well solve your next problem ...)
by MrSwiss
Jan 17, 2019 15:04
Forum: Beginners
Topic: DIR does list (some) files as directories
Replies: 14
Views: 270

Re: DIR does list (some) files as directories

A more recent example, can be found in "Beginners": DIR() question
(Assume it to be FBC 64 bit compatible too, older stuff may have problems.)
Forum-Search is your friend ...
by MrSwiss
Jan 15, 2019 22:39
Forum: Tips and Tricks
Topic: Water Effect v0.55
Replies: 10
Views: 382

Re: Water Effect v0.4

When I use -gen gcc then the cmd box will be opened always. May be due to the IDE used ... In FBEdit, this is the case on "quick run", but not for "compile + run", which has different settings: "quick run" = always a console "compile + run" = multiple options...
by MrSwiss
Jan 15, 2019 22:10
Forum: Tips and Tricks
Topic: Water Effect v0.55
Replies: 10
Views: 382

Re: Water Effect v0.4

#Include "windows.bi" and FreeConsole deleted I'd also delete that, for any OS, including WIN. In order to NOT open a console on WIN, simply use compiler switch: fbc -s gui (additional to other compiler switches) I'm not likely to include 1.5 MB "windows.bi", for no compelling r...
by MrSwiss
Jan 13, 2019 23:41
Forum: Tips and Tricks
Topic: CountInString()
Replies: 16
Views: 461

Re: CountInString()

dodicat,

I think it's somewhere in the c-runtime, have you noticed:
#Include "crt.bi" ? Probably, crt/string.bi.
by MrSwiss
Jan 12, 2019 21:19
Forum: Projects
Topic: pcg32rr.bi - minimal PCG32_random_r implementation ( (c) Melissa E. O'Neill )
Replies: 1
Views: 71

Re: pcg32rr.bi - minimal PCG32_random_r implementation ( (c) Melissa E. O'Neill )

Here is the code I've used for the above mentioned tests. IMPORTANT: - only for FBC 64 bit (otherwise, undefined results) you'll have to FIRST uncomment the following two procedures in 'pcg32rr.bi': - pcg32dbl2() and - pcg32dbl3() It's best to comment them after speed test(s) is/are run. Code: /' pc...
by MrSwiss
Jan 12, 2019 20:58
Forum: Projects
Topic: pcg32rr.bi - minimal PCG32_random_r implementation ( (c) Melissa E. O'Neill )
Replies: 1
Views: 71

pcg32rr.bi - minimal PCG32_random_r implementation ( (c) Melissa E. O'Neill )

Hi all, The 32 bit minimal C code from Melissa E. O'Neill translated to FreeBASIC. Only the really necessary procedures added, to deal with issues like: - Initialization (random initial values, Mersenne Twister based, FB's CRT lib.) - Initialization (user supplied initial values), user controlled in...
by MrSwiss
Dec 23, 2018 1:43
Forum: Community Discussion
Topic: Nominations for Forum Moderators
Replies: 70
Views: 3689

Re: Nominations for Forum Moderators

Just to present the other half of the coin: I've said: stay, where you currently are (off the forum), aka: "stay where the pepper grows", which is lightly different, from what our best reknown liar, is trying hard, to imply. The jump into the Lake, was done by himself, without any help by ...
by MrSwiss
Dec 22, 2018 23:50
Forum: Community Discussion
Topic: Nominations for Forum Moderators
Replies: 70
Views: 3689

Re: Nominations for Forum Moderators

deltarho[1859] wrote: As a final note, my returning to the fold will be aided by your being a member of the team. Dodicat, that alone is a good reason to accept ;-) Because I disagree with jj2007: Dodicat, that alone is a acceptable reason, to decline the "job" offer. Apart from that, the...
by MrSwiss
Dec 21, 2018 17:29
Forum: Beginners
Topic: Array pointer assignment
Replies: 26
Views: 634

Re: Array pointer assignment

Another approach, which may illustrate the ptr changing method. Assume that we are doing Circles this time ... 0) define Type as needed 1) generate a (largish) static array of Type (holding all needed info, for Circle statement) 2) generate a alias (Type Ptr) 3) generate a (smallish) dyn. array of a...
by MrSwiss
Dec 20, 2018 17:04
Forum: Tips and Tricks
Topic: Type FixLenStr (fixed size String Type)
Replies: 3
Views: 220

Re: Type FixLenStr (fixed size String Type)

After doing some more tests, I've had to extend code in Let Operator, to let it deal with a uninitialized Type, also ... Since the initial version of SetStr always DeAllocated/Callocated memory, the recoded version only does it, when new size <> old size ... Updated code, in above post, the .bi file...

Go to advanced search