## Search found 2857 matches

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)
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...
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...
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...
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 ...)
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.)
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...
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...
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.
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...
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...
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 ...
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...
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...
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...