PDA

View Full Version : Writing to a file - PROBLEM


W.E.T.
06-16-2004, 03:52 PM
I am writing a piece of code in Fortran 77and I have come accross and I have an unusual problem. I want to output some data to a .csv file. I have the following:


write (12,20) type1, car1,Rubbish1(j),
>',,,section_image.gif,',Item1(j)
> ,',','\nPart Number: ',Part1(j),
> '\nOther Details: ',
> Extra1(j),',',Price1(j),',,,0,',Part1(j),'--',dupC,',',ve1
...it all works fine except for the dupC bit. The dupC is defined below:


dupC = dupC + 1
... So, the dupC should read 1,2,3 etc. down the file. However I get a rectangle box (presume this means that it does not know what the format is). I have tried writing this value to screen and it works fine. dupC is an integer.


Any ideas???

Thanks

Nick

tzeis
06-16-2004, 10:10 PM
The problem is probably in Format statement 20. The square box usually means that it is trying to print an unprintable character.

W.E.T.
06-17-2004, 09:16 AM
Oh yea, so it is. It all becomes clear now :p

I hate it when you miss stupid things like that.

I haven't tried it yet, but I know that, that is the problem.

In case I dont find out - do you know how to declare an integer in a format statement???

Thanks