Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Meaning of write statement

Status
Not open for further replies.

rajabadsha

Programmer
May 4, 2006
11
CA
Hi,
With reference to the following code, which I posted yesterday, I have few more questions if anyone can kindly reply.

1)How is pow_start, pow_end, and pow_step initiated? Are _start, _end and _step a keyword?
2)When I run this program the write statement "write(6,200) project_name" prints the output to the screen. But isn't it suppose to print it to a file?
Program contbc

parameter (ndwgt=1000,ndpow=1000)

dimension cplot(ndwgt,ndpow)

character*80 project_name
character*80 control_file

open(10,file="setup.dat",form="formatted",
x status="old")

200 format(a)
read(10,200) project_name
write(6,200) project_name
read(10,200) control_file
write(6,200) control_file

read(10,*) nwgt_start,nwgt_end,nwgt_step
write(6,*) nwgt_start,nwgt_end,nwgt_step
read(10,*) pow_start,pow_end,pow_step
write(6,*) pow_start,pow_end,pow_step

close(10)

 
1) pow_start etc are read in
Code:
read (10,*) pow_start, pow_end, pow_step
_start etc are not keywords
2) write (6 ... will normally print to the screen. If you want it to print to a file, put the following before using write (6
Code:
open (6, file='out.txt', status='new')
and put the following before the end of the program
Code:
close (6)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top