C Library Functions - strgar3 (3)
NAME
strgar3(3f) - [M_hybrid] fetch a value from language dictionary but process via calculator too
CONTENTS
Synopsis
Description
Example
SYNOPSIS
subroutine strgar3(line,iread,default,numbrs,inums,delims,delimc,ierr)
character(len=*),intent(in) :: line
integer,intent(in) :: iread
real,intent(in) :: default
real,intent(out) :: numbrs(iread,4)
integer,intent(out) :: inums
character(len=1),intent(in) :: delims
character(len=1),intent(in) :: delimc
integer,intent(out) :: ierr
DESCRIPTION
This is a special-purpose clone of strgar2 that expects each string to return
two values with a : character splitting the values. If the second string does
not exist, the current file value is unchanged. For example, the string
"10:20 30 40 50:60" with a default of -1 would return
+--+--+--+--+
|10|30|40|50| curve numbers (or curve ranges)
+--+--+--+--+
|20|-1|-1|60| file numbers
+--+--+--+--+
|-1|-1|-1|-1| top error curve numbers possibly set by e()
+--+--+--+--+
|-1|-1|-1|-1| bottom error curve numbers possibly set by e()
+--+--+--+--+
The number on the left of the colon is assumed to exist. This if for the
purpose of letting USH use the syntax curvenumber:filename and has no other
purpose. It is not really part of the calculator.
EXAMPLE
Sample program
program demo_strgar3
use M_hybrid, only : strgar3
use M_calculator, only : rnum0
implicit none
character(len=90) :: string
real :: values(10,4)
integer :: ios, inums, ierr
do
values(:,:)=-123
write(*,*)*strgar3* Enter string like 10:1 20 30 40:50
read(*,(a),iostat=ios)string
if(ios.ne.0)stop
call strgar3(string,10,-1.0,values,inums, , ,ierr)
write(*,*)inums=,inums
write(*,*)ierr=,ierr
write(*,*)values(:,1)=,values(:inums,1)
write(*,*)values(:,2)=,values(:inums,2)
write(*,*)values(:,3)=,values(:inums,3)
write(*,*)values(:,4)=,values(:inums,4)
enddo
end program demo_strgar3
Expected output
$ demo_strgar3
*strgar3* Enter string like 10:1 20 30 40:50
10:2 22 33 40:44
inums= 4
ierr= 0
values(:,1)= 10.0000000 22.0000000 33.0000000 40.0000000
values(:,2)= 2.00000000 -1.00000000 -1.00000000 44.0000000
values(:,3)= 0.00000000 0.00000000 0.00000000 0.00000000
values(:,4)= 0.00000000 0.00000000 0.00000000 0.00000000
*strgar3* Enter string like 10:1 20 30 40:50
| Nemo Release 3.1 | strgar3 (3) | June 29, 2025 |
Generated by manServer 1.08 from 642a0b2e-8041-4958-b7a3-84860ada344d using man macros.