Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor - changing original values
Message
De
04/05/2015 10:20:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/05/2015 18:02:47
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01619360
Message ID:
01619384
Vues:
46
>Hello comunity
>
>I need some help and example regarding Cursor.
>
>The application that i am using create a cursor with the account and values for the accountancy program and i need to change some account of the cursor (Cursor Name :TESTE) before sending the movment on accountancy.
>Someone could give a simple exemple on how to change values on original cursor, create a new one based on the original, change values on this new cursor and finally return/replace the new data to the original Cursor with the new values:
>for ex:
>
>my original cursor TESTE have the following conta (account) and edebito (DEBIT value) and ecredito (CREDIT value):
>
>Account                debit                         credit
>3111131                 162,87
>3111131                                              162,87
>321                         174,67
>24321131                 37,46
>221111                                                212,84
>3111111                   11,80
>3111111                                                11,80
>243211111                 0,76
>
>I pretend the replace the original Cursor TESTE with this result:
>225111               162,87 
>24321131             37,46
>221111                                                 212,84
>225111                 11,80
>24321111               0,71
>
>In fact,base on orginal Cursor TESTE, i need to do theses changes
>1 line : if account = '311' aand Debit <> 0 then account = 225111
>2.line : if account = '311' and Credit <> 0 then DELETE
>3.line: if account = '321' then DELETE
>4.line: if account = '24321131' OK Keep
>5.line: if account = '221 ' OK Keep 
>6.line :  if account = '311' aand Debit <> 0 then account = 225111
>7.line : if account = '311' and Credit <> 0 then DELETE
>8.line : if account = '243211111' the  OK Keep
>
>Note : i have try this code
>
>Select  * from  TESTE into Cursor NewCursor READWRITE
>--I have make the changes
>Select TESTE
>DELE ALL
>Append from dbf("NewCursor")
>
>
>But the result of the Original Cursor TESTE don´t change.
>
>
>
>Many thanks for your help,
>Luis Santos

The easiest way to do that is to make an SQL select into:
*...
Select  * from  TESTE into Cursor NewCursor READWRITE
*--I have make the changes
Select * from NewCursor into TESTE nofilter
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform