2,740
社区成员
发帖
与我相关
我的任务
分享
CLOSE DATABASES
CREATE TABLE Random (cValue N(3))
FOR nItem = 1 TO 10 && Append 10 records,
APPEND BLANK
REPLACE cValue WITH 1 + 100 * RAND( ) && Insert random values
ENDFOR
CLEAR
LIST && Display the values
gnMaximum = 1 && Initialize minimum value
gnMinimum = 100 && Initialize maximum value
SCAN
gnMinimum = MIN(gnMinimum, cValue)
gnMaximum = MAX(gnMaximum, cValue)
ENDSCAN
? 'The minimum value is: ', gnMinimum && Display minimum value
? 'The maximum value is: ', gnMaximum && Display maximum value
CLEAR
gnLower = 1
gnUpper = 10
? INT((gnUpper - gnLower + 1) * RAND( ) + gnLower)