Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fill with previous values
Message
De
30/10/2020 01:30:56
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
30/10/2020 01:10:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01676862
Message ID:
01676865
Vues:
37
>Dear Experts,
>
> I have these codes
>
>
>Create Cursor table1 (sno N(3), ratio N(5,2))
>Insert Into table1 Values(1,5.6)
>Insert Into table1 Values(2,0)
>Insert Into table1 Values(3,0)
>Insert Into table1 Values(4,7.8)
>Insert Into table1 Values(5,0)
>Insert Into table1 Values(6,0)
>Insert Into table1 Values(7,3)
>Insert Into table1 Values(8,0)
>
>
>The result looks like this
>https://ibb.co/2c1LxBG
>
>But I need this result
>https://ibb.co/GdNbW0x
>
>Example:
>
>record 1
>
>ratio is 5.60
>
>record 2
>
>ratio 0
>
>Want to fill record 2 with 5.60 until next ratio is found.
>
>Please

There are things called variables. They hold there values until changed.
LOCAL lnField1,lnField2
lnField1 = 1
lnField2 = 5.6
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 2
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 3
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 4
lnField2 = 7.8
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 5
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 6
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 7
lnField2 = 7.3
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = 8
Insert Into table1 Values(m.lnField1,m.lnField2)
One might even consider to solve the problem with the incrementing values of Field # 1 like
lnField1 = 0
lnField1 = lnField1+1
lnField2 = 5.6
Insert Into table1 Values(m.lnField1,m.lnField2)
lnField1 = lnField1+1
Insert Into table1 Values(m.lnField1,m.lnField2)
*...
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform