12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- # DH_Functions
- !! String Format
- if $ARGS[0] = 'FormatStr':
- $.FUNC_formatStr = $ARGS[1]
- $.FUNC_params_[0] = $ARGS[2]
-
- _FUNC_i = 0
- :Loop DH_Functions_FormatStr_Params
- if _FUNC_i < ARRSIZE('$ARGS') - 2:
- $.FUNC_params_[_FUNC_i] = $ARGS[_FUNC_i + 2]
- _FUNC_i += 1
- jump 'Loop DH_Functions_FormatStr_Params'
- end
-
- _FUNC_i = 0
- :Loop DH_Functions_FormatStr_Replace
- if _FUNC_i < ARRSIZE('$.FUNC_params_'):
- $.FUNC_formatStr = $REPLACE($.FUNC_formatStr, '{<<_FUNC_i>>}', $.FUNC_params_[_FUNC_i])
- _FUNC_i += 1
- jump 'Loop DH_Functions_FormatStr_Replace'
- end
-
- $RESULT = $.FUNC_formatStr
- end
- !! Concatenate string array
- if lcase($ARGS[0]) = 'ConcatStrArr':
- KILLVAR '$_FUNC_concat'
- KILLVAR '$_FUNC_concatStr'
- COPYARR '$_FUNC_concat', '<<$ARGS[1]>>'
-
- _FUNC_i = 0
- :Loop DH_Functions_ConcatStrArr_Concatenate
- if (_FUNC_i < ARRSIZE('$_FUNC_concat'):
- $_FUNC_concatStr += $_FUNC_concat[_FUNC_i]
-
- _FUNC_i += 1
- jump 'Loop DH_Functions_ConcatStrArr_Concatenate'
- end
-
- $RESULT = $_FUNC_concatStr
- end
- --- DH_Functions ---------------------------
- # StrInsert
- !! Original = $ARGS[0]
- !! Insert = $ARGS[1]
- !! Position = ARGS[2]
- $RESULT = mid($ARGS[0], 1, ARGS[2] - 1) + $ARGS[1] + mid($ARGS[0], ARGS[2])
- --- StrInsert ------------------------------
|