Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 19957, more flexibility to FOR statement with Step or List

by Herbert Welte Email: Anonymous


for i:= 0 to 10 step 2 do ...;
for i:= [0,2,4,6,8,10] do ...;
Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 7.0  to 7.0 7 downloads
Copyright: No significant restrictions


Size: 0 bytes
Updated on Tue, 30 Dec 2003 13:36:59 GMT
Originally uploaded on Sun, 11 May 2003 05:39:46 GMT
Description
I would like to have a more flexible for statement. In former basic it was long time ago already available. A new step statement for the increasing part should be easyly to implement. In this way source code looks nicer and is more easy to read.

A list of values to be assiged would be the next wish. This especially for own types like

type tcolor = (red, green, blue, yellow);

Var color : tcolor;

for color:= [red, yellow] do ..;

means that the loop is called 2 times, first for red and than for yellow.

or maybe another syntax like

foreach color in [red, yellow] do ...;

Herbert

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03