Commit 866a7131 authored by Graham, Aaron's avatar Graham, Aaron
Browse files

Merge branch 'string_fixes' into 'master'

String fixes

See merge request futility/Futility!351
parents 4c13f7aa dfd72afa
Pipeline #167269 passed with stage
in 2 minutes and 15 seconds
......@@ -1057,7 +1057,7 @@ ENDFUNCTION isNumeric
!>
!> A positive tolerance narrows the range, while a negative tolerance increases it
!>
ELEMENTAL FUNCTION isBetween_SNK(a,val,b,tolerance) RESULT(between)
IMPURE ELEMENTAL FUNCTION isBetween_SNK(a,val,b,tolerance) RESULT(between)
INTEGER(SNK),INTENT(IN) :: a
INTEGER(SNK),INTENT(IN) :: val
INTEGER(SNK),INTENT(IN) :: b
......
......@@ -2729,37 +2729,61 @@ SUBROUTINE getString_ParamType_scalar(thisParam,name,string,sskfmt,sdkfmt)
string=param%val
TYPE IS(ParamType_SSK_a1)
WRITE(tmpchar,TRIM(sskfmtDef)) param%val(1)
IF(SIZE(param%val) > 0) THEN
string=delim//TRIM(ADJUSTL(tmpchar))//delim//' '
ELSE
string=delim//' '
ENDIF
DO i=2,SIZE(param%val)
WRITE(tmpchar,TRIM(sskfmtDef)) param%val(i)
string=string//delim//TRIM(ADJUSTL(tmpchar))//delim//' '
ENDDO
TYPE IS(ParamType_SDK_a1)
WRITE(tmpchar,TRIM(sdkfmtDef)) param%val(1)
IF(SIZE(param%val) > 0) THEN
string=delim//TRIM(ADJUSTL(tmpchar))//delim//' '
ELSE
string=delim//' '
ENDIF
DO i=2,SIZE(param%val)
WRITE(tmpchar,TRIM(sdkfmtDef)) param%val(i)
string=string//delim//TRIM(ADJUSTL(tmpchar))//delim//' '
ENDDO
TYPE IS(ParamType_SNK_a1)
IF(SIZE(param%val) > 0) THEN
string=delim//str(param%val(1))//delim//' '
ELSE
string=delim//' '
ENDIF
DO i=2,SIZE(param%val)
string=string//delim//str(param%val(i))//delim//' '
ENDDO
TYPE IS(ParamType_SLK_a1)
IF(SIZE(param%val) > 0) THEN
string=delim//str(param%val(1))//delim//' '
ELSE
string=delim//' '
ENDIF
DO i=2,SIZE(param%val)
string=string//delim//str(param%val(i))//delim//' '
ENDDO
TYPE IS(ParamType_SBK_a1)
WRITE(tmpchar,'(L1)') param%val(1)
IF(SIZE(param%val) > 0) THEN
string=delim//TRIM(ADJUSTL(tmpchar))//delim//' '
ELSE
string=delim//' '
ENDIF
DO i=2,SIZE(param%val)
WRITE(tmpchar,'(L1)') param%val(i)
string=string//delim//TRIM(ADJUSTL(tmpchar))//delim//' '
ENDDO
TYPE IS(ParamType_STR_a1)
IF(SIZE(param%val) > 0) THEN
string=delim//param%val(1)//delim//' '
ELSE
string=delim//' '
ENDIF
DO i=2,SIZE(param%val)
string=string//delim//param%val(i)//delim//' '
ENDDO
......
......@@ -575,8 +575,12 @@ FUNCTION replace_pattern(this,oldPat,newPat) RESULT(retStr)
!Set-up the new string
IF(SIZE(tokens) > 1) THEN
retStr = ''
ELSE
IF(this == oldPat) THEN
retStr=newPat
ELSE
retStr = char(tokens(1))
ENDIF
RETURN
ENDIF
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment