| 86 | <!--Fortran section --> |
| 87 | <div class="bhoechie-tab-content"> |
| 88 | <center> |
| 89 | <h3>C</h3> |
| 90 | <pre class="language-fortran"> |
| 91 | <code> Integer FUNCTION HELLOF(zoo_main_cfg,zoo_inputs,zoo_outputs) |
| 92 | & RESULT (R) |
| 93 | Integer R, ls, iLenStr |
| 94 | CHARACTER*(1024) zoo_main_cfg(10,30),zoo_inputs(10,30), |
| 95 | & zoo_outputs(10,30) |
| 96 | CHARACTER*(1024) TMP |
| 97 | |
| 98 | write(0,*) 'Hello '//zoo_inputs(4,1)//' from the Fortran world !' |
| 99 | |
| 100 | ls = iLenStr(zoo_inputs(4,1)) |
| 101 | TMP = zoo_inputs(4,1) |
| 102 | zoo_outputs(1,1) = 'name'//CHAR(0) |
| 103 | zoo_outputs(2,1) = 'result'//CHAR(0) |
| 104 | zoo_outputs(3,1) = 'value'//CHAR(0) |
| 105 | zoo_outputs(4,1) = 'Hello '//TMP(1:ls)// |
| 106 | & ' from the Fortran world !'//CHAR(0) |
| 107 | zoo_outputs(5,1) = 'datatype'//CHAR(0) |
| 108 | zoo_outputs(6,1) = 'string'//CHAR(0) |
| 109 | |
| 110 | R = 3 |
| 111 | Return |
| 112 | END |
| 113 | |
| 114 | Integer Function iLenStr(cString) |
| 115 | Character*(*) cString |
| 116 | Integer iLen,i |
| 117 | |
| 118 | iLen = Len(cString) |
| 119 | Do i=iLen,1,-1 |
| 120 | If(ichar(cString(i:i)).NE.0) Goto 10 |
| 121 | EndDo |
| 122 | i = 1 |
| 123 | 10 Continue |
| 124 | iLenStr = i |
| 125 | |
| 126 | Return |
| 127 | End Function iLenStr/code> |
| 128 | </pre> |
| 129 | </center> |
| 130 | </div> |
| 131 | |
| 132 | |