I’m thinking as a Delphi 7 programmer with Delphi 11
1/ why can I not use ‘Not’ in - While Not Str[I] in['', ‘/’, ‘-’] do Inc(I);
2/ Why is some type data sizes like Byte, Word not allowed to be used
3/ PreakPoints are set on the left side of the editor and I get a read dot and I can set it gray
But I cannot get the tick in the red dot for debugging uses, so I can get the view > breakpoint windows > breakpoint - window open ok
But I cannot get the tick in the red dot for debugging uses
what is wrong
4/ I put in my code
type
Byte64 = NativeUInt;
// because ‘NativeUInt’ to me is a stupid word
The “not” operator takes precedence over the “in” operator, so what your code is effectively saying is:
While (Not Str[I]) in['', ‘/’, ‘-’] do Inc(I);
Which doesn’t make much sense. What you need to do is to add a set of brackets like so:
While Not (Str[I] in['', ‘/’, ‘-’]) do Inc(I);
I’m not clear on what you’re asking here - can you provide some context? Are you using SizeOf(Byte) etc?
Do you get blue dots on the left hand side when you run the program? Are you running with debugging? Are you compiling in Debug configuration or Release configuration? To get working break points, you need to compile in Debug configuration and Run with Debugging (F9)
NativeUInt is short for Native Unsigned Integer and will be either 4 bytes in size on 32 bit platforms or 8 bytes on 64 bit platforms. NativeUInt is the unsigned equivalent of NativeInt. You could argue that NativeInteger and NativeUnsignedInteger are clearer but they’d be getting a bit long for my taste, but you could define them if you wanted to. Byte64 would be a bad choice in my opinion as it could easily mislead someone into thinking that it was a value storing 64 bytes. On 32 bit platforms, the name would have absolutely no relationship with reality at all.
1/ ok I have to make the Boolean question and contain it in brackets because it interferes with the ‘In’ statement - I think I can get that but did not do that in the past with Delphi 7 its must be done to be more defining in the code rather than to the if statement…
2/ Byte
in a procedure
procedure MyProcedure( …)
var
c: byte; // byte is an error and need to use integer or something much bigger -why?
and at the same time
TCusObject = class(TObject)
Protected
FSize: Byte; // this is good and I think stable
3/ Are you compiling in Debug configuration or Release configuration?
what is Debug configuration or Release configuration? with the Delphi menus > run > breakpoints I have options of windows about breakpoints but no configuration controls
4/ I need a Unsigned Integer of 8 bytes or 64 bit on all platforms!!!
this was not available on Delphi 7 just int64 that was always signed is their a QWord or anything like that
Also, with the above code, have you considered what will happen if the string doesn’t contain any of those characters?
While Not I in [1, 2] do Inc(I);
Also FYI, although the above code will compile in both Delphi 7 and 12.1, it’s not going to do what you’re probably expecting it to do - it’ll do a bitwise not on I first and then check to see if it’s in the set.
Rodger Plant thanks
I was playing yesterday with the build configurations and nothing was happening at all
took my computer of standby after waking up
ticks in red dots and it stops at the break points!!!
I’m in action!!!
why I will never know?
I like the new statement to me - ’ CharInSet() ’ that is my logic to get a Boolean result!!!
But I must remember to bracket after the ‘Not’ statement
I good good answers to me - thanks - you made my day you could say - thanks