

PiedSoftware
Members-
Content Count
58 -
Joined
-
Last visited
Community Reputation
3 NeutralAbout PiedSoftware
- Birthday 02/01/1961
Technical Information
-
Delphi-Version
Delphi 10.4 Sydney
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I just used claude for a while. I asked it to write a function to return the number of bytes in a string. It generated code that looked right, but I didn't check the unicode specs to confirm. But it had an error. It use a for i := loop but in the loop had inc(i) which of course does not compile. But I just told it that that wouldn't work and it replaced it with a while loop. Also it responded well to my style specifications, like having all the reserved words in lower case. I haven't tried others. Maybe DeepLink will be worth a look. I hope that helps.
-
Delphi uses OneDrive. How can I make it use my local storage?
PiedSoftware replied to PiedSoftware's topic in Delphi IDE and APIs
I meant the only option for disconnecting that OneDrive offered. It didn't let me disconnect some directories by not others. -
Delphi uses OneDrive. How can I make it use my local storage?
PiedSoftware replied to PiedSoftware's topic in Delphi IDE and APIs
Thanks for clarifying that. I surfed around and disconnected OneDrive entirely. That was the only option. -
Delphi uses OneDrive. How can I make it use my local storage?
PiedSoftware posted a topic in Delphi IDE and APIs
I keep getting messages from OneDrive that it is close to full (4.5GB of 5GB), with of course an offer for me to purchase more. I went looking at at the folder and found that most of it (4.53 GB) is in C:\Users\Mark\OneDrive\Documents\Embarcadero\Studio Is there some process for making Delphi use some other folder for that and getting away from OneDrive? I'm concerned about the risk of corrupting my Delphi installation. Regards Mark -
How to refer to a single value from an enumerated type declared in a set type?
PiedSoftware posted a topic in RTL and Delphi Object Pascal
In Delphi in System.Class we have this declaration: TShiftState = set of (ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble, ssTouch, ssPen, ssCommand, ssHorizontal); Given that declaration, how can I declare a variable that will be just one of those values?- 7 replies
-
- pascal
- enumerate type
-
(and 1 more)
Tagged with:
-
Type inference in assignment but not comparison??
PiedSoftware replied to PiedSoftware's topic in RTL and Delphi Object Pascal
Thanks for thinking about it Dave. But ... It already knows the type of a to be an array, so a set interpretation is ruled out. And for arrays, nil and [] mean the same thing. That is why the assignment operator works. So, I think it is reasonable to expect the compile to test for equality with the same syntax. -
Type inference in assignment but not comparison??
PiedSoftware posted a topic in RTL and Delphi Object Pascal
I like the way Delphi is getting better at arrays, but there is still a gap in the compiler that let me down. I tried this code in 12.2 to highlight the issue. const nostrings: tarray<string> = []; procedure TForm1.FormShow(Sender: TObject); begin var a: tarray<string>; a := []; if a = nostrings then say('nostrings'); if a = [] then say('it''s blank'); end; procedure TForm1.say(const s: string); begin ListBox1.Items.Add(s); end; This refuses to compile at the line if a = [] then with the error "Incompatible types". But it has no problem with the assignment, so it looks like the programmers have just put this in the "do eventually" basket. Does anyone have any insights into this? --- Mark -
Yes, definitely. XCode does that, and you need it.
-
Yes, it would be much better if sets has a different punctuation from arrays. Sets came first though, and they got [ and ] on a first come first choose basis. If Delphi could yield { and } from comments and give it to arrays or sets, life would be better.
-
Delphi should let me use a const array reference as a constant
PiedSoftware replied to PiedSoftware's topic in RTL and Delphi Object Pascal
The way Swift works is that you can declare value with either the keyword let or the keyword var. If you use let the value cannot be changed. But the expression you assign to a let value can be anything available at that point. -
Delphi should let me use a const array reference as a constant
PiedSoftware replied to PiedSoftware's topic in RTL and Delphi Object Pascal
I guess I am a bit spoiled playing with Swift. It lets you assign any expression to a constant, compile time or run time. -
Delphi should let me use a const array reference as a constant
PiedSoftware replied to PiedSoftware's topic in RTL and Delphi Object Pascal
Yes, David, I agree. I would like them to fill that out: everything that is logically able to be evaluated at compile time should be assignable to a constant. -
Delphi should let me use a const array reference as a constant
PiedSoftware posted a topic in RTL and Delphi Object Pascal
type TCodeStructure = record StartTkn: string; EndTkn: string; SubTkns: array of string; end; type TIfTkns = (itElse, itElsif); const elseTkn = '#else'; elsifTkn = '#elseif'; IfTkns: array[TIfTkns] of string = (elseTkn, elsifTkn); IfStruct: TCodeStructure = (StartTkn: '#if'; EndTkn: '#endif'; SubTkns: [IfTkns[itElse], IfTkns[itElsif]]); I wrote this code and got the error "E2026 Constant expression expected" on the last line. I also tried SubTkns: IfTkns); When I changed it to SubTkns: [elseTkn, elsifTkn]); it compiled happily. and that gave me E2010 Incompatible types: 'Dynamic array' and 'Array'. To me it seems that Delphi should allow the first thing I tried - referencing a const array via constant indices to specify a constant. There is no reason to disallow that sort of thing. Ideally even the second attempt should be reasonable. I have Delphi 10.4. -
Opening form takes 1 minute in debugger, 2.5 s without
PiedSoftware replied to PiedSoftware's topic in Delphi IDE and APIs
I went to Component | Install Packages and unchecked "Embarcadero LiveBindings Components" and saved, but when I closed and reopened Delphi, it was back on again. D'oh! I'm concerned the maybe a library is using it. How can I work that out? Should I remove it? -
Opening form takes 1 minute in debugger, 2.5 s without
PiedSoftware replied to PiedSoftware's topic in Delphi IDE and APIs
Thank. What I am comparing are the 2 functions from the Delphi Run menu: Run (f9) and Run without debugging (shift-ctrl-f9)