Jump to content
dormky

"for i in" goes in reverse

Recommended Posts

18 minutes ago, dormky said:

What the ****?

Please keep the profanity out.

Delphi treats the constant in that statement as a set. See this.

  • Like 4

Share this post


Link to post

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

 

Share this post


Link to post

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
Posted (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...

1983398469_Recording2024-07-11at18_59_26.thumb.gif.f0f3b1187b673d2bc4c416ed59adf94e.gif

 

Edited by Der schöne Günther

Share this post


Link to post
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...

1983398469_Recording2024-07-11at18_59_26.thumb.gif.f0f3b1187b673d2bc4c416ed59adf94e.gif

 

Code editors telling you stuff is great but the bigger problem is the missing functionality at the fundamental language level. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×