HyperWorks Solvers

STR2DBLARY

STR2DBLARY

Previous topic Next topic No expanding text in this topic  

STR2DBLARY

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Subroutine Type

Utility/Data Access

Definition

Converts string data into double or double array.

Use

The function can be called by any user-defined subroutine.

Calling Syntax

Fortran

CALL STR2DBLARY(STRG, ARRAY, NSIZE, ISTAT)

 

C

c_str2dblary(strg, array, nsize, istat)

 

Python

[array, istat] = py_str2dblary(strg)

 

MATLAB

[array, istat] = m_str2dblary(strg)

Input Arguments

 

[string]

STRG

A string variable containing the data to be converted into double precision numbers.

Output Values

[double] ARRAY

The string data, converted into a double precision array.

 

[integer] NSIZE

Returns the number of double precision numbers found in the string, separated by spaces.

 

[integer] ISTAT

0

If the call to STR2DBLARY was successful.

 

 

n

Any nonzero integer returned if the call to STR2DBLARY was unsuccessful.

Comments

1.STR2DBLARY is useful for processing the string output from MODFNC subroutine.
2.You are responsible for providing sufficient storage in the output array.

Example

If the input string contains a double, e.g., “1.234”, then the call to STR2DBLARY yields an output ARRAY(1)= 1.234, NSIZE=1, and ISTAT=0 (normal return).

If the input string contains “1.234 5.678”, then the call to STR2DBLARY yields an output ARRAY(1)= 1.234, ARRAY(2)= 5.678, NSIZE=2 and ISTAT=0 (normal return).

The prototype for STR2DBLARY can be found in the C include header msolvsub_c_include.h in the folder [install-path]\hwsolvers\usersub\c_src\include.

See Also:

MODFNC

STR2INTARY

Data Access Subroutines