Topic: Call to system function
General question regarding the use of the system call as per the examples below:
iresult=system(trim(ShellCommand))
call system(trim(ShellCommand),iresult)
Is there any preference on whether one uses the first or second form of the system call? I am asking because I just discovered the second form after reading the GNU documentation on this feature and learning that it can be a function or a subroutine call. I was using the first form extensively and kept running into memory segmentation faults and could not understand why (see previous forum threads by me). These memory faults would crop up occasionally, in different run instances and different machine; seemed to be completely random and rare.
After finding out about the second form above, I switched the code over to the call system form. The instance that was causing problems now doesn't exhibit the memory fault but that really means nothing as it is a new instance and problem with differing memory usage. I am just wondering if there is something know to be different in those two system calls methods?
FYI, I am still using SF 2.41, build 2559 and GNU 7.2.0 FORTRAN.
Thanks,
Rod