You are right. I thought that the "".i trick worked also for floats...
What you write is totally different from my case. You are just iterating among the 3 elements of an array, not among 55 elements of a sequence from 8.562 to 12.13 in steps of 0.065, as I would get from the system() call above.
rather, one could use the system() call (as you teach): p for [i in system("seq 8.562 0.065 12.137")] (i+0) t i which is clean enough. However, if it wasn't a big change, the direct iteration (without workarounds) would be best. There's really so much to change to get this? Thank you, Roberto
The promotion to string can always be done by "".i i.e. by concatenating with an empty string. Your sprintf() solution is indeed a workaround, but it could actually make the script quite more complex and messy than it should be. Take for example an apparently simple case like: p for [i = 8.562 : 12.137 : 0.065] "data_".i This format would be clear and straight, and does not require one to work it around by something like: end=int((12.137-8.562)/0.065) plot for [i=0:end] sprintf("data_%.3f", 8.562+i*0.065)...
The promotion to string can always be done by "".i i.e. by concatenating with an empty string. Your sprintf() solution is indeed a workaround, but it could actually make the script quite more complex and messy than it should be. Take for example an apparently simple case like: p for [i = 8.562 : 12.137 : 0.065] "data_".i This format would be clear and straight, and does not require one to work it around by something like: end=int((12.137-8.562)/0.065) plot for [i=0:var] sprintf("data_%.3f", 8.562+i*0.065)...
The promotion to string can always be done by "".i i.e. by concatenating with an empty string. Your sprintf() solution is indeed a workaround, but it could actually make the script quite more complex and messy than it should be. Take for example an apparently simple case like: p for [i = 8.562 : 2.137 : 0.065] "data_".i This format would be clear and straight, and does not require one to work it around by something like: end=int((12.137-8.562)/0.065) plot for [i=0:var] sprintf("data_%.3f", 8.562+i*0.065)...
The promotion to string can always be done by "".i i.e. by concatenating with an empty string. Your sprintf() solution is indeed a workaround, but it could actually make the script quite more complex and messy than it should be. Take for example an apparently simple case like: p for [i = 8.562 : 0.065 : 12.137] "data_".i This format would be clear and straight, and does not require one to work it around by something like: end=int((12.137-8.562)/0.065) plot for [i=0:var] sprintf("data_%.3f", 8.562+i*0.065)...
any feedback?