Search found 1680 matches

by jj2007
Nov 29, 2020 23:56
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

xlucas wrote:when I said that "Integer is a 64 bit field of which only 32 bits can be used and the rest is wasted") is wrong, it is so on purpose
I give up.
by jj2007
Nov 29, 2020 9:42
Forum: General
Topic: Pentacles
Replies: 14
Views: 644

Re: Pentacles

I had never seen the Draw command - cute!
by jj2007
Nov 26, 2020 2:02
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

Show me one example where, in 32-bit code, an integer takes 64 bits. Got it the 'wrong way around' as seems to be 'on purpose' always (and, definitely NOT funny!). What does your confused code have to do with the OP's statement "an Integer is but a 64 bit field of which only 32 bits can be use...
by jj2007
Nov 25, 2020 17:32
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

caseih wrote:Given his explanation of what he meant, he's definitely not wrong
xlucas wrote:a 64 bit field of which only 32 bits can be used, that is, a waste of memory
The wording is pretty clear - and he is wrong. There is no "64-bit field", and there is no waste of memory. In 32-bit code, an integer uses 32 bits of memory, fullstop.
by jj2007
Nov 25, 2020 16:15
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

That's funny - who invented this integer<32> stuff? Why not long<32> or long32 or short<32>? Why is there no ptrsize (which would actually be useful)? Oops, I see that Print sizeof(any ptr), "ptr" works... Print sizeof(short), "short" Print sizeof(integer), "integer" Pr...
by jj2007
Nov 25, 2020 15:43
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

caseih wrote:So perhaps he's correct and we should be urging FB programmers to stop using Integer.
The problem arose in the moment when somebody decided to call 64-bit variables in 64-bit code "integer", contrary to most other languages. It's a big ugly mess, though - and not only in FB - see this Wikipedia article. And this is just plain wrong:
xlucas wrote:an Integer is but a 64 bit field of which only 32 bits can be used, that is, a waste of memory
Sorry to be rude, xlucas, but before posting something you should make an effort to understand and prove your case.
by jj2007
Nov 25, 2020 9:03
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

xlucas wrote:As I said, it's a dramatic way of saying it
Show me one example where, in 32-bit code, an integer takes 64 bits. It doesn't have to be dramatic, just factual.
by jj2007
Nov 23, 2020 9:44
Forum: General
Topic: When to use Integer and when not to
Replies: 23
Views: 479

Re: When to use Integer and when not to

In most practical aspects, an Integer is but a 64 bit field of which only 32 bits can be used, that is, a waste of memory Is it, really? Dim MyHex1 As integer=&H1234ABCD, MyHex2 As integer=&H12345678, MyHex3 As integer=&H33333333 asm lea eax, [MyHex1] lea edx, [MyHex2] lea ecx, [MyHex3]...
by jj2007
Nov 20, 2020 19:40
Forum: General
Topic: Split 8bit in 4bit
Replies: 26
Views: 630

Re: Split 8bit in 4bit

caseih wrote:Again you misread. I never said anything about masking by &0F before shifting right
Sorry, my fault, what you wrote is correct.
caseih wrote:the initial masking with &hF0
by jj2007
Nov 20, 2020 18:48
Forum: General
Topic: Antivirus hurt by functions pasting text on clipboard - sometimes
Replies: 12
Views: 270

Re: Antivirus hurt by functions pasting text on clipboard - sometimes

Tourist Trap wrote:Why would it be a crashing part? Do you mean the code is broken?

Code: Select all

## HEAP[TmpFb.exe]:
## Invalid address specified to RtlGetUserInfoHeap( 00760000, 009D2938 )
by jj2007
Nov 20, 2020 17:48
Forum: General
Topic: Split 8bit in 4bit
Replies: 26
Views: 630

Re: Split 8bit in 4bit

Not everyone. It does occur to me that when putting this into a macro for convenience, since there's no type associated with the macro, the initial masking with &hF0 (or masking to &h0F after the shift) ensures that the macro works with any size of numeric type Show me a type where masking ...
by jj2007
Nov 20, 2020 17:30
Forum: General
Topic: Antivirus hurt by functions pasting text on clipboard - sometimes
Replies: 12
Views: 270

Re: Antivirus hurt by functions pasting text on clipboard - sometimes

The code was for text (ansi) - jj2007 For unicode this is better. Your code works fine, but too much acrobatics for my basic taste. My snippet above works fine, too, if you put 2*Len+2. The point is another one: You tell the compiler "it's unicode" with #Define UNICODE. Fine, so the compi...
by jj2007
Nov 20, 2020 10:30
Forum: General
Topic: Split 8bit in 4bit
Replies: 26
Views: 630

Re: Split 8bit in 4bit

caseih wrote:Why is everyone masking the byte with &hF0 before shifting right?
Not everyone.
jj2007 wrote:Amazing how much code can be produced for something as simple as that...

Code: Select all

dim as ubyte value = &b1010110
print bin(value)
print bin(value shr 4);" ";bin(value and &HF)
sleep

Go to advanced search