Update of /cvsroot/win32forth/win32forth/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20289/win32forth/src
Modified Files:
Class.f
Log Message:
gah:Added code to handle 2 dimensional arrays
Index: Class.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth/src/Class.f,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Class.f 3 Aug 2006 13:08:22 -0000 1.21
--- Class.f 16 Sep 2006 10:44:46 -0000 1.22
***************
*** 523,527 ****
synonym <Object <Super
! \ *G See <Super
synonym <Class <Super
\ *G See <Super.
--- 523,527 ----
synonym <Object <Super
! \ *G See <Super.
synonym <Class <Super
\ *G See <Super.
***************
*** 1119,1127 ****
: M@ ( -- n )
! \ *G Fetch the contents of the first cell of the object. Designed for use with VAR
POSTPONE ^base POSTPONE @ ; IMMEDIATE
: M! ( n -- )
! \ *G Store the TOS into the first cell of the object. Designed for use with VAR
POSTPONE ^base POSTPONE ! ; IMMEDIATE
--- 1119,1127 ----
: M@ ( -- n )
! \ *G Fetch the contents of the first cell of the object. Designed for use with VAR.
POSTPONE ^base POSTPONE @ ; IMMEDIATE
: M! ( n -- )
! \ *G Store the TOS into the first cell of the object. Designed for use with VAR.
POSTPONE ^base POSTPONE ! ; IMMEDIATE
***************
*** 1163,1166 ****
--- 1163,1172 ----
IF idxBase 2 - w@ ( #elems ) * + CELL+ THEN ;
+ \ ====================================================================
+ \ Support for 2 dimensional arrays
+
+ cell newuser ColDim
+ cell newuser RowDim
+
\ =====================================================================
\ Runtime indexed range checking. Use +range and -range to turn range
***************
*** 1192,1195 ****
--- 1198,1208 ----
initialization-chain chain-add +range
+ classes
+
+ : Dimension ( Rows Cols -- Size )
+ \ *G Set the dimensions for the next 2 dimensional array to be created (either at compile
+ \ ** time, or at run-time using NEW>) and return the size (Rows*Cols). \n
+ \ ** For dynamic object DIMENSION applies to the next 2 dimensional array in the same task.
+ ColDim ! RowDim ! ColDim RowDim * ;
previous
|