FORTRAN system routine (135 Views)
Occasional Contributor
Posts: 7
Registered: ‎12-06-2005
Message 1 of 3 (135 Views)
Accepted Solution

FORTRAN system routine


I have a sneaking suspicion that the FORTRAN system routine only accepts character strings of a fixed length (like 40 or 80) although in all of the documentation I've read says nothing about it.

If anyone has had problems with the routine or has any tricks of the trade I'd love to hear them; I'm a new programmer and I need all the tricks I can get!

Acclaimed Contributor
Posts: 17,825
Registered: ‎07-16-1998
Message 2 of 3 (135 Views)

Re: FORTRAN system routine

Most implementations of the 3F system() function impose a 1023 character maximum length limit on the string. I suspect your problem is that you are not appending a NUL just past the last significant character.
If it ain't broke, I can fix that.
Esteemed Contributor
Posts: 356
Registered: ‎05-14-1996
Message 3 of 3 (135 Views)

Re: FORTRAN system routine

The man page for system(3f) says:

String can not be longer than NCARGS-50
characters, as defined in .

On my machine (HPUX 11.22, f90 2.8.6) NCARGS
appears to be 2048000. Check your value of

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.