Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActiveRow property always zero:(
Message
De
18/07/2001 08:21:07
 
 
À
18/07/2001 07:51:40
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00531902
Message ID:
00531923
Vues:
13
Thanks Cetin,

I have a table with items of work in it.
One item contains a value that has to be impacted on another item.

so my rows need to look similar to the following
Code            Description               Qnt  Unit         Cost
95A0101/1       LABOUR                     1    E           1000
95A0102/1       % ADjustment for labour   20    %            200
95A0201/1       PLANT                      1    E            500
95A0202/1       % ADjustment for Plant    10    %             50
The idea is that whenever I change the value of the LABOUR Cost then
the % Adjustment column will be updated.

In the above example the cost of labour is 1000 so the % adjustment is 200
because that is 20% of 1000.

I have tried writing code for the QNT valid that does the following.
* This routine is called from the grid quantity valid
* it will calculate the percentage variation item 
* It assumes that the percentage variation code will be 1 greater than the provisional sum code
* Eg. 
* If the provisional sum code is 95A0101/1 it assumes the Variation item will be 95A0102/1
sele v_tickitm
lcSumCode=V_tickitm.code
lcVarCode=strtran(v_tickitm.code,'1/1','2/1')
lnSumAmount=v_tickitm.cost

* move the rcord pointer to the percentage variation item

locate for v_tickitm.code=lcVarCode
with Thisform.ItemGrid

  .recchange()
if found()
   .CostColumn.cost.value = (lnSumAmount/100)*	.RateColumn.rate.value && v_tickitm.rate contains the percentage amount to apply
   .CostColumn.cost.refresh
else
   messuser('<alert> You have deleted a Dayworks variation item. Please ensure all standard dayworks items are the tender')
endif
 
endwith
I did this after my attempts to do the work on the underlying table failed becuase I could not get my grid to refresh.


I am using a Highliting grid so at present I am creating a test area that does not use the highliting grid so I can rule it out.

I am really stuck so all help most gratefully received:)

















>>I am trying to do some calculations in a grid.
>>I am using it a little like a spreadsheet.
>>
>>However I notice that as I move around my grid the Grid.Activerow
>>and the grid.relativerow always appear to read zero.
>>
>>I need these poperties to work because I am hoping to use the Activatecell(nrow,nCol) method and it will need the right co-ordinates to work.
>>
>>I have been forced into trying to do it this way because I tried doing my calculations on the underlying table but could not get my grid to refresh with the new data, so if someone knows how I can get the grid to refresh. (grid.refresh does not work) then I may be saved having to sort out the above problem.
>>
>>
>>Many Thanks
>
>Mark,
>Grid active* and relative* are nonzero when focus on grid. However they're zero between some events. I should warn you using them you force your grid to work slower.
>Probably you don't even need a refresh. It depends on type of calculation. More clue on that pls :)
>Cetin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform