Ttelmah Guest
|
|
Posted: Mon Feb 13, 2006 10:19 am |
|
|
Yes, and no...
The code generated to handle a stream, is 'hardwired', to the I/O bit used. So you cannot use a variable to transfer it, and gain anything. The code has to exist seperately for each stream. However there is nothing to stop you from passing the name to a function, and then use a switch statement to select the required routine. The names can be passed as an int8 variable, so:
Code: |
void fn(int8 chr,int8 stream) {
switch (stream) {
case hard :
fputc(chr,hard);
break;
case soft :
fputc(chr,soft);
break;
}
}
|
With streams called 'hard', and 'soft', will allow you to send characters to a named stream.
Best Wishes |
|