Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 To: Shaheryar Rashed
  Where is Shaheryar Rashed?
 Multan
 Pakistan
 Shaheryar Rashed
 Tags
Subject: RE: array result issue
Thread ID: 395696 Message ID: 395698 # Views: 33 # Ratings: 3
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Friday, January 17, 2014 11:36:21 AM         
   


> Hi Experts!
>
> my code is:
>
>
LOCAL lnMhd1, lnHr1, mlntot1
> STORE 0 TO lnMhd1, lnHr1, mlntot1
> lnHr1  = 10
> lnMhd1 = 25
> mlntot1 = (lnHr1 * lnMhd1)*3600
> SUM(mlntot1) to array laTotalTime1
> WAIT WINDOW laTotalTime1
> 

>
> it should be 900000 but it returns 4 times multiplied result. guide me please

Your selected cursor/table has 4 records

LOCAL lnMhd1, lnHr1, mlntot1
STORE 0 TO lnMhd1, lnHr1, mlntot1
lnHr1  = 10
lnMhd1 = 25
mlntot1 = (lnHr1 * lnMhd1)*3600
* First time 0 records, 0
CREATE CURSOR epsilon (ii I autoinc)
SUM(mlntot1) to array laTotalTime1
WAIT WINDOW laTotalTime1
* Second time 1 record, 900000
APPEND BLANK
SUM(mlntot1) to array laTotalTime1
WAIT WINDOW laTotalTime1
* Third time 2 record, 2x900000
APPEND BLANK
SUM(mlntot1) to array laTotalTime1
WAIT WINDOW laTotalTime1
* Forth time 3 record, 3x900000
APPEND BLANK
SUM(mlntot1) to array laTotalTime1
WAIT WINDOW laTotalTime1
* Fifth time 4 record, 4x900000
APPEND BLANK
SUM(mlntot1) to array laTotalTime1
WAIT WINDOW laTotalTime1



My respects

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