Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

FORTRAN system routine

SOLVED
Go to Solution
Occasional Contributor

FORTRAN system routine

Hello,

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!

Thanks
2 REPLIES
Acclaimed Contributor [Founder]

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.
Highlighted
Esteemed Contributor [Founder]

Re: FORTRAN system routine

The man page for system(3f) says:

BUGS
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
NCARGS.