![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NoMachine NX 3.2.0-1 (Web Builder branch) | iBot | Software Releases - RSS News | 0 | 05-13-2008 08:10 PM |
| NoMachine NX 3.1.0-4 (Web Builder branch) | iBot | Software Releases - RSS News | 0 | 03-10-2008 06:40 PM |
| NoMachine NX 3.1.0-3 (Web Builder branch) | iBot | Software Releases - RSS News | 0 | 03-03-2008 05:10 PM |
| NoMachine NX 3.1.0-1 (Web Builder branch) | iBot | Software Releases - RSS News | 0 | 01-15-2008 07:40 AM |
| C++/g++ builder for LINUX??? | RohitThakkar | High Level Programming | 1 | 08-27-2005 09:08 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
C++ (Borland Builder) question
If anyone uses this can you help please;
I want to use a for loop to update several Objects without having to write them all into the script, e.g., If I have CheckBox1, CheckBox2, CheckBox3 etc I want loop round something like for (int i=1;i<10;i++) CheckBox(i)->State = 1; Where CheckBox(i) would equal CheckBox1, CheckBox2 ... How do I get the code to recognise that CheckBox(i) is in fact CheckBox1 etc Any help or pointers would be appreciated |
|
||||
|
Note that Borland Builder is a Windows product, and this is a UNIX forum. We can answer language questions, but you're not likely to find answers for API specific things. Also note that it's a very poor idea to declare variables inside a for loop like that. That does wildly different things on different compilers; sometimes it works, sometimes it causes compiler errors, sometimes it breaks things silently. Don't do it. I'd make an array: Code:
int i;
Object *checklist[]={checkbox1, checkbox2, checkbox3, checkbox4, NULL};
for(i=0; checklist[i] != NULL; i++)
checklist[i]->State=1;
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|