home *** CD-ROM | disk | FTP | other *** search
- 'User's Manual Example, Page 300.
- '
- 'Will not compile with DIM STATIC iarray%(1:n%).
- 'Changed $LINK "sum.obj" to $LINK "umex301.obj".
- 'Must compile "umex301.asm" to an .obj file.
- 'Added $LIB and $ERROR statements to reduce .EXE size.
- '
- '*************************************************************
-
- $LIB ALL OFF
- $ERROR ALL OFF
-
- n% = 200 '200 elements in array
- DIM iarray%(1:n%)
- DECLARE FUNCTION suminteger&( INTEGER, INTEGER )
- $LINK "umex301.obj"
-
- FOR i% = 1 to n% 'initialize iarray%()
- iarray%(i%) = i%
- NEXT i%
-
- thesum& = suminteger&( iarray%(1), n%) 'sum all 200 elements
- PRINT "Array iarray%()'s sum = "; thesum&
- END
-
-