Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActiveRow property always zero:(
Message
De
19/07/2001 04:47:14
 
 
À
18/07/2001 09:15:25
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:
00532399
Vues:
15
Many Thanks Cetin

Your solution works just great:)
It made my attempt look very clumsy:(

I am finally a PUTM so you may be able to put a face to all these questions you have answered soon.

Mark



>Snipped to save bandwidth + pasting partial code.
>Create a form and add a grid (highlighted or native)
>Set columncount to 5
>Add below code to targets.
>
>
* Form.load
>Create cursor TestCursor ;
>  (Code c(10),Description c(30),Qnt i, Unit c(1),Cost i)
>lnItems = 20
>For ix = 1 to lnItems
>  For jx=1 to 2
>    lnAdjust = iif(jx=1,1,int(rand()*10)*10)
>    Insert into TestCursor ;
>      values ;
>      ('95A'+transform(ix*100+jx,'@L 9999')+'/1',;
>      iif(jx=1,'','% Adjustment for ')+iif(ix%2=0,'PLANT','LABOUR'),;
>      lnAdjust, iif(jx=1,'E','%'),;
>      iif(jx=1,int(rand()*100)*100,lnLastValue*lnAdjust/100) )
>    lnLastValue = TestCursor.Cost
>  Endfor
>Endfor
>cursorsetprop('buffering',5,'testcursor')
>
>* Cost column (5) textbox.lostfocus
>With this.Parent.Parent
>  lcAlias = .RecordSource
>  lcCurCode = eval(lcAlias+'.Code')
>  If at('1/1',lcCurCode)=0
>    Return
>  Endif
>  lcAdjKey = stuff(lcCurCode,at('/',lcCurCode)-1,1,'2')
>  lnCost = eval(lcAlias+'.Cost')
>  Update (lcAlias) ;
>    set Cost = Qnt*lnCost/100 ;
>    where Code = lcAdjKey
>Endwith
>Note: Used local vars assuming recordsource name was not known beforehand. Otherwise I would directly say :
>
..
>If at('1/1',myTable.Code)=0
>   Return
>Endif
>lcAdjKey = stuff(myTable.Code,at('/',myTable.Code)-1,1,'2')
>..
Cetin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform