Closed peter-sondhauss closed 4 months ago
Ok, thanks, I is able to replicate it on my U2204
Since Formats are tricky and lot of details and need larges tests, just or the record I recall we have two other bugs related to that : #1712 and #1706
pro test_issue1796
openw, lun, GDL_IDL_FL()+'_issue1796.txt',/get_lun
printf, lun, format='($,I0)', 123
printf, lun, format='(I0)', 456
printf, lun, format='(I0,$)', 123
printf, lun, format='(I0)', 456
close, lun
end
diff IDL_issue1796.txt GDL_issue1796.txt
2c2,3
< 123456
---
> 123
> 456
According to IDL documentation if the format code $ occurs anywhere in the format string, the new line implied by the closing parenthesis of the format string is suppressed. Hence the following consecutive print commands should provide the same results, but they don't:
printf, 1, format='($,I0)', 123 printf, 1, format='(I0)', 456
provides 123456 as it should, but
printf, 1, format='(I0,$)', 123 printf, 1, format='(I0)', 456
provides 123 456 which is wrong. I guess this bug was introduced during some recent bug fixes in the format interpretation.