dormky 2 Posted July 11, 2024 (edited) Done using https://www.onlinegdb.com/online_pascal_compiler, but Delphi 10.3 does the same. What the fork ? Edited July 11, 2024 by Sherlock Rephrased Share this post Link to post
Dave Nottage 567 Posted July 11, 2024 18 minutes ago, dormky said: What the ****? Please keep the profanity out. Delphi treats the constant in that statement as a set. See this. 5 Share this post Link to post
David Heffernan 2354 Posted July 11, 2024 Classic delphi type ambiguity consequence Share this post Link to post
Uwe Raabe 2064 Posted July 11, 2024 A workaround would be to declare the array as a constant or create a dynamic array on the fly: for I in TArray<Integer>.Create(45, 30, 15) do 1 Share this post Link to post
Brandon Staggs 285 Posted July 11, 2024 Why oh why would you write a for statement like that? As others already said, you're declaring a set, so you are getting the expected behavior. I presume in your mind you expect it to be treated like an array. If that is the case, then you need to use an array instead of a set. Share this post Link to post
Der schöne Günther 316 Posted July 11, 2024 (edited) In cases like this, I really love code editors and environments that can tell me right away to what type something infers by just tapping Ctrl+Alt... Edited July 11, 2024 by Der schöne Günther Share this post Link to post
David Heffernan 2354 Posted July 12, 2024 12 hours ago, Der schöne Günther said: In cases like this, I really love code editors and environments that can tell me right away to what type something infers by just tapping Ctrl+Alt... Code editors telling you stuff is great but the bigger problem is the missing functionality at the fundamental language level. 1 Share this post Link to post
PiedSoftware 3 Posted September 25, 2024 On 7/11/2024 at 9:50 PM, David Heffernan said: Classic delphi type ambiguity consequence 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. Share this post Link to post
PiedSoftware 3 Posted September 25, 2024 On 7/12/2024 at 3:05 PM, David Heffernan said: Code editors telling you stuff is great but the bigger problem is the missing functionality at the fundamental language level. Yes, definitely. XCode does that, and you need it. Share this post Link to post