Code Comments
Programming Forum and web based access to our favorite programming groups.Hello,
...well, I'm not a Fortran Crack.
Does anybody know a way to make Fortran Programs NOT to
send CR/LF when writing text to a screen? (Similar as
write('#') in Pascal would do or PRINT"#"; in Basic?
WRITE(6,FMT='(I7)' ) ITOTDO
BACKSPACE(6)
Is not working, the program crashes:
500
backspace: can't backspace file
apparent state: unit 6 (unnamed)
lately writing sequential formatted external IO
8 [sig] gen_source 1692 open_stackdumpfile: Dumping stack trace to
my_program.exe.stackdump
I'm currently using g77 in a Windows/Cygwin environment.
Regards,
Christian
Post Follow-up to this message"Christian Hoffmann" <brcwcs@gmx.net> wrote in message news:30mejcF33jv2tU1@uni-berlin.de... WRITE(6,FMT='(I7)' , advance = 'no' ) ITOTDO Regards, Mike Metcalf
Post Follow-up to this messageMichael Metcalf wrote: > WRITE(6,FMT='(I7)' , advance = 'no' ) ITOTDO > > Regards, > > Mike Metcalf > > Hi Mike, unfortunately my cygwin-g77 doesn't like it: my_program.F: In subroutine `my_program1': my_program.F:687: WRITE(6,FMT='(TR5,I7)',advance='no') ITODO ^ Unsupported WRITE control item at (^) -- ADVANCE= and EOR= are not supported make: *** [my_program.obj] Error 1 The only way I found is to use an ESCAPE-Sequence like that: WRITE(6,FMT='(A1,"[A",I7)') char(27),ITODO which is a bit slower but working. Maybe there is more intelligent way... Regards Christian
Post Follow-up to this message"Christian Hoffmann" <brcwcs@gmx.net> wrote in message news:30o6aaF3290bgU1@uni-berlin.de... > which is a bit slower but working. Maybe there is more intelligent way... > There is: use g95, see www.g95.org. Regards, Mike Metcalf
Post Follow-up to this messageUse the '$' format descriptor, which is available in g77: $ cat x.f write(*,'(A15$)')'this is line 1' write(*,*)' and so is this' end $ g77 x.f $ ./a.out this is line 1 and so is this HTH, bud davis
Post Follow-up to this messageChristian Hoffmann <brcwcs@gmx.net> writes: > unfortunately my cygwin-g77 doesn't like it: That's because it is a f77 compiler. Advance="no" was standardized in f90. There is no standard or portable way in f77. For details, See many past threads on the same question, but mostly you will find material about the various tricks that work with various f77 compilers; there is none that will work in all f77 environments. You escape sequences certainly are among the tricks that will not work in all environments, but do work in some. If they work for the environment you need, then I guess you have your answer; just be aware that it won't work everywhere. Take whatever cautions seem appropriate to separate it out as a potential porting issue. -- Richard Maine email: my last name at domain domain: summertriangle dot net
Post Follow-up to this messageThanks for your hints! Regards, Christian
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.