vfp中年月转大写,用什么函授,求回复。
现在做报表打印,其中,字符型的阿拉伯数字年月日,需转换成大写打印,如何解决。如 1984 需要打印成一九八四
FUNCTION numtoc LPARAMETERS Pnum LOCAL xretu,xcchr,ii,xnum,xpos xcchr = '一二三四五六七八九0' xretu = '' xnum = TRANSFORM(Pnum) FOR ii=1 TO LEN(xnum) xpos = VAL(SUBSTR(xnum,ii,1)) IF xpos=0 xpos = 10 ENDIF xretu = xretu + SUBSTR(xcchr,xpos*2-1,2) ENDFOR RETURN xretu
[此贴子已经被作者于2022-1-12 09:46编辑过]
ALINES(arr,"○,一,二,三,四,五,六,七,八,九",",") ?fun("1984") ?fun("1990") FUNCTION fun(ds) ret = "" FOR i=1 TO LEN(ds) ch = SUBSTR(ds,i,1) IF BETWEEN(ch,"0","9") ret = ret + arr[VAL(ch)+1] ELSE RETURN "" ENDIF ENDFOR RETURN ret ENDFUNC