Problem with printf
- Posted by Allen Robnett <alrobnett at alumni.princeton.edu> Dec 31, 2003
- 623 views
Printf works fine in my app, with sequence slice to limit the number of characters actually printed: printf(1,"%8s",data_array[rec_no][1..6]) for example. For reasons other than coding elegance, I need to have the arguments of printf read from another array. It works fine for everything except the slice specification. The interpreter will not accept 1..6 read into the final [ ] via a subscripted array element. As of now, I am using "if" statements to select between several different printf's with different sequence slice specs. Is there a better way? Allen