home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ob140os2.zip / PTRDEMO.B < prev    next >
Text File  |  1997-09-12  |  285b  |  20 lines

  1. * This demo shows the use of pointers
  2.  
  3.  DIM X(10) AS LONG
  4.  DIM P AS LONG POINTER
  5.  DIM I AS LONG
  6.  
  7.  FOR I=1 TO 10
  8.         X(I)=I*100
  9.  NEXT I
  10.  P=ADDR(X)
  11.  PRINT [P]' prints X(1)
  12.  INC P
  13.  PRINT [P]' prints X(2)
  14.  P=INDEX(P,2)
  15.  PRINT [P]' print X(4)
  16.  [P]=1234
  17.  PRINT X(4)
  18.  
  19.  
  20.