automatic label generator

rzamith

Member
Joined
May 22, 2006
Messages
5
Programming Experience
3-5
Hi everyone,

I'm trying to develop a Gantt Chart, based on the amount of tasks chosen by the user. Can anyone tell me how do I make a cycle that automatically creates de labels (as the chart bars), depending on the number of tasks?

Thanks,
Rui Zamith
 
If you're using words like "cycle" then you need to use a loop. Which loop type to use depends on your situation. Often you could use many or all of the possibilities but one usually stands out as the best option. You have For, For Each, While, Do, Do While with pre-test, Do While with post-test, Do Until with pre-test and Do Until with post-test. At a glance I'd probably use For Each in your case. Pseudo-code:
VB.NET:
For Each task In taskList
    Create Label
Next task
 
Back
Top