Operating System - Linux
1751922 Members
4716 Online
108783 Solutions
New Discussion юеВ

Re: FORTRAN system routine

 
SOLVED
Go to solution
Alex Rauket
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 2
A. Clay Stephenson
Acclaimed Contributor
Solution

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.
Gregory Fruth
Esteemed Contributor

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.