Silverfrost Forums

Welcome to our forums

Writng to a binary file

1 Jun 2012 7:42 #10248

I have a file open -binary file as below:

open(unit=10,file=my_file_name,status='unknown',form='unformatted',
access='direct',recl=512*8)

The file needs to contain 512 words of 8 bytes each. Now I want to write few words forst as below:

!word_count_no is predefined

 write(10,rec=record_no)geom_data(word_count_no:512)

I get an error saying that a sub-string must be a character type.

Can anyone advise what is wrong?

1 Jun 2012 10:58 #10250

How did you define the variable geom_data?

Perhaps you can use

write(10,rec=record_no)(geom_data(k),k=word_count_no,512)

Regards - Wilfried

Please login to reply.