Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

No Linefeed on Text Screen using Backspace?
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


Report this thread to moderator Post Follow-up to this message
Old Post
Christian Hoffmann
11-25-04 08:57 PM


Re: No Linefeed on Text Screen using Backspace?
"Christian Hoffmann" <brcwcs@gmx.net> wrote in message
news:30mejcF33jv2tU1@uni-berlin.de...

WRITE(6,FMT='(I7)' , advance = 'no' ) ITOTDO

Regards,

Mike Metcalf



Report this thread to moderator Post Follow-up to this message
Old Post
Michael Metcalf
11-25-04 08:57 PM


Re: No Linefeed on Text Screen using Backspace?

Michael 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


Report this thread to moderator Post Follow-up to this message
Old Post
Christian Hoffmann
11-26-04 02:02 PM


Re: No Linefeed on Text Screen using Backspace?
"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



Report this thread to moderator Post Follow-up to this message
Old Post
Michael Metcalf
11-26-04 02:02 PM


Re: No Linefeed on Text Screen using Backspace?
Use 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

Report this thread to moderator Post Follow-up to this message
Old Post
bud davis
11-26-04 09:09 PM


Re: No Linefeed on Text Screen using Backspace?
Christian 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

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Maine
11-26-04 09:09 PM


Re: No Linefeed on Text Screen using Backspace?

Thanks for your hints!

Regards,

Christian


Report this thread to moderator Post Follow-up to this message
Old Post
Christian Hoffmann
11-29-04 09:07 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:53 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.