07-05-2006 03:09 AM
07-05-2006 04:19 AM
Hello Juha
just for my information, what language are you using?
anyway you can generate the string via table lookup and then call RunIOtask with this string as parameter.
If you want flexibility read the strings/address combinations from file.
greetings from a dry country (almost as hot as Austin today)
07-05-2006 04:40 AM
@-Juha- wrote:
Hello,How can i make this shorter?int address ;switch (address){case 0:RunIOTask ("0:0") ;break;case 1:RunIOTask ("0:1") ;break;case 2:RunIOTask ("0:2") ;break;case 3:RunIOTask ("0:3") ;break;case 4:RunIOTask ("0:4") ;break;..case 30:RunIOTask("0:30) ;break;}
Try something like
int address ;
char addr[5];
if ( address >= 0 && address <= 30) {
Fmt (addr,"%s<0:%i",address);
RunIOTask(addr);
}
07-05-2006 05:06 AM