InMat function

Returns the number of elements read into a dimensioned array after a MatRead statement has successfully executed.

retval = InMat()

None.

In retval, the number of elements read into a dimensioned array after a MatRead.

*This code fragment reads row '1' from the CUSTOMERS table into a dimensioned array called CUST.
*The values in the columns that have been read in are displayed.

 

declare subroutine fsmsg

declare function msg

 

Open "CUSTOMERS" To CUST_FILE Else

  fsmsg()

  Return 2

End

 

* read row with key '1' into CUST array.

KEY = '1'

Dim CUST(30)

MatRead CUST From CUST_FILE, KEY Else

   fsmsg()

   return 2

End

 

* display the value in each column.

num_elements = inMat()

for i = 1 to num_elements

  retval = msg (@window , 'Element number ' : i : ' = ' : CUST(i))

next i
 
 
  • guides/programming/programmers_reference_manual/inmat.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1