*傳入:每行字數,列數
FUNCTION add_random_text
LPARAMETERS plens,prows
LOCAL nrows,ncols
IF EMPTY(plens)
plens=255
ENDIF
IF EMPTY(prows)
prows=1
endif
retStr=''
FOR nrows=1 TO prows
FOR ncols=1 TO plens
retStr=retStr+CHR(INT(RAND()*(126-32+1))+32)
*INT(RAND()*(126-32+1))+32 :產生介於(含) 32~126間的亂數
NEXT ncols
retStr=retStr+CHR(13)
NEXT nrows
RETURN retStr
ENDFUNC
*
沒有留言:
張貼留言