Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 To: Shaheryar Rashed
  Where is Shaheryar Rashed?
 Multan
 Pakistan
 Shaheryar Rashed
 Tags
Subject: RE: array result issue
Thread ID: 395696 Message ID: 395711 # Views: 28 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Friday, January 17, 2014 12:31:32 PM         
   


> >
> >
> > Here is the explanation to your confusion:
> > SUM command will run (execute the summing) repeatedly as many times as the number of records of a table / cursor that is active at that particular time it is run and store the end-result to the variable (somehow not sure why you use array thou). For example when I ran it just now I got 76500000 as a result of 10 * 25 * 3600 * 85(= reccount of my active cursor at the moment)
> >
> > So.. you need to always be fully aware of behaviors of certain / all commands
> >
> > Aaah, post beaten by Vilhem - my processor speed is lame ! :-)
> >
> > David
>
> i know sum() is creating problem here. i want to know how to store my result to array like :
>
> (lnHr1 * lnMhd1)*3600 to array laTotalTime1


as the Help tells you if you use "TO ARRAY" clause in SUM function or command then system will AUTOMATICALLY create the array if one is still not existing at the time of run. Your earlier/original code listing did prove it!.
An array is actually just a series of variable(s) and I believe in that case system has already done what you asked by somehow creating your wanted "array" but apparently of just single element. If you want certain other behavior / style / whatever of the array then you have to pre-define it when declaring the array which should be done before assigning value(s) to it (unfortunately you have not said anything as to how and why the use of the array)

David

.

ENTIRE THREAD

array result issue Posted by Shaheryar Rashed @ 1/17/2014 11:11:21 AM
RE: array result issue Posted by Stefan Wuebbe @ 1/17/2014 11:25:59 AM
RE: array result issue Posted by Borislav Borissov @ 1/17/2014 11:38:15 AM
RE: array result issue Posted by Vilhelm-Ion Praisach @ 1/17/2014 11:53:40 AM
RE: array result issue Posted by Shaheryar Rashed @ 1/17/2014 12:08:54 PM
RE: array result issue Posted by Vilhelm-Ion Praisach @ 1/17/2014 12:25:24 PM
RE: array result issue Posted by Stefan Wuebbe @ 1/17/2014 12:27:42 PM
RE: array result issue Posted by Shaheryar Rashed @ 1/17/2014 12:12:11 PM
RE: array result issue Posted by Stefan Wuebbe @ 1/17/2014 2:06:52 PM
RE: array result issue Posted by Vilhelm-Ion Praisach @ 1/17/2014 11:36:21 AM
RE: array result issue Posted by David Mustakim @ 1/17/2014 11:38:05 AM
RE: array result issue Posted by Shaheryar Rashed @ 1/17/2014 12:06:14 PM
RE: array result issue Posted by David Mustakim @ 1/17/2014 12:31:32 PM
RE: array result issue Posted by Vilhelm-Ion Praisach @ 1/17/2014 12:23:05 PM