I need help with arrays QB 
Author Message
 I need help with arrays QB

I need to know how to add up the rows and/or columbs of an array to
come up with an average

EXAPLE
        DIM a(60,60)
how would I get average for the whole second row if I am using a(r,c)
as my variables

please respond



Fri, 13 Apr 2001 03:00:00 GMT  
 I need help with arrays QB

Quote:

>I need to know how to add up the rows and/or columbs of an array to
>come up with an average

>EXAPLE
> DIM a(60,60)
>how would I get average for the whole second row if I am using a(r,c)
>as my variables

   OPTION BASE 1
   DIM A(60,60)
   Total = 0
   FOR C = 1 TO 60
      Total = Total + A(2,C)
   NEXT
   Average = Total / 60

- or -

   OPTION BASE 0
   DIM A(60,60)
   Total = 0
   FOR C = 0 TO 60
      Total = Total + A(2,C)
   NEXT
   Average = Total / 61
--

Sun Valley Systems    http://personal.bhm.bellsouth.net/~judmc
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."



Fri, 13 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. NEED HELP DISABLING QB COMMANDS:IMMEDIATE REP. NEEDED

2. Need help in reading the joysticks in QB..

3. need help on a QB graphics routine.

4. QB 4.5 SHELL command in large programme help needed

5. * Need help with QB 4.0

6. Need help adding QC functions to QB library.

7. QB Comm help needed

8. Help needed: QB 4.5 and TSR

9. QB screen 12 background color help needed

10. need help: MSCDEX CD-ROM programming in QB 4.5

11. -----HELP NEEDED: .BMP AND .WAV FILES IN QB?----

12. NEED HELP DISABLING QB COMMANDS:IMMEDIATE REP. NEE

 

 
Powered by phpBB® Forum Software