Subroutine Type |
Utility/Data Access |
||||||
Definition |
Converts string data into integer or integer array. |
||||||
Use |
The function can be called by any user-defined subroutine. |
||||||
Calling Syntax |
FortranCALL STR2INTARY(STRG, ARRAY, NSIZE, ISTAT)
Cc_str2intary(strg, array, nsize, istat)
Python[array, istat] = py_str2intary(array)
MATLAB[array, istat] = m_str2intary(array) |
||||||
Input Arguments |
[string] STRG |
A string variable containing the data to be converted into integer. |
|||||
Output Values |
[integer] ARRAY |
The string data, converted into an integer array. |
|||||
[integer] NSIZE |
Returns the number of integers found in the string, separated by spaces. |
||||||
[integer] ISTAT |
0 |
If the call to STR2INTARY was successful. |
|||||
|
n |
Any nonzero integer, returned if the call to STR2INTARY was unsuccessful. |
|||||
Comments |
|
||||||
Example |
To access the body_id of the marker with id=30101010 in the XML file as follows: <Reference_Marker id = "30101010" body_id = "30101" body_type = "RigidBody" /> from a Fortran user subroutine you may call CALL MODFNC('Reference_Marker',30101010,'body_id', STRG,INFO) CALL STR2INTARY(STRG, ARRAY, NSIZE, ISTAT) In this example, the STRG returns a value of ‘30101’ and the INFO returns a value of 2, indicating a single integer. The subsequent call to STR2INTARY using STRG as input yields an output ARRAY(1)=30101, NSIZE=1, and ISTAT=0 (normal return). The prototypes of STR2INTARY and STR2DBLARY can be found in the C include header msolvesub_c_include.h in the folder [install-path]\hwsolvers\usersub\c_src\include. |
See Also: