-
- RPGLE中REPLACE函数的用法
- 2011-08-26
%REPLACE(replacement string: source string{:start position {:source length to replace}})%REPLACE returns the character string produced by inserting a replacement string into the source string, starting at the start position and replacing the specified number of characters.
The first and second parameter must be of type character, graphic, or UCS-2 and can be in either fixed- or variable-length format. The second parameter must be the same type as the first.
The third parameter represents the starting position, measured in characters, for the replacement string. If it is not specified, the starting position is at the beginning of the source string. The value may range from one to the current length of the source string plus one.
The fourth parameter represents the number of characters in the source string to be replaced. If zero is specified, then the replacement string is inserted before the specified starting position. If the parameter is not specified, the number of characters replaced is the same as the length of the replacement string. The value must be greater than or equal to zero, and less than or equal to the current length of the source string.
The starting position and length may be any numeric value or numeric expression with no decimal positions.
The returned value is varying length if the source string or replacement string are varying length, or if the start position or source length to replace are variables. Otherwise, the result is fixed length.
- Views(6264) | Comments(0) | In AS400について
-
- AS400命令行CALL程序时传递数字参数总结
- 2011-07-25
对于S类型的参数,只要按照字符串的形式,在没有数字的位置补0,不用输入小数点,就可以得到正确的结果,如果是负数,在第一位输入负号 - 即可,但是会占用一个数字位,7位的负数就只能输入6位数字了。
对于P类型的参数,数字部分按照S类型的一样输入,还需要在字符串前加 X,并且如果长度为奇数,需要给字符串加 F 后缀,如果长度为偶数,需要在字符串的前后都加 F。如果是负数的,需要把字符串后面的F变为E。(X表示按16进制取值,由于P类型的数据存储方式是半个字节存储一个数字,所以需要在前后加其它的字母补齐空位。)- Views(7078) | Comments(0) | In AS400について
