Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append blank and replace
Message
De
06/05/1998 09:42:42
 
 
À
06/05/1998 01:27:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00097155
Message ID:
00097296
Vues:
22
Cetin,

Thank you for your reply
underneath you find the code.

It used to be a part of an older foxpro 2.6 program. As far as i can see it should work fine, what it does most of the time. Not always.
I have had already changed the code into 'INSERT INTO' (that's why most of it has '*' in front of it), because I thought the problem could be there, but it keeps popping up. So even with with this code I sometimes have empty records...




the '$$' marks are inserted to comment the program for you

sele consol
set order to consol

$$: of course order consol is on xsysnr + prj + dtos(datum)

** maak record bij als nodig is
if !seek(hp_ad.xsysnr+hp_ad.prj+dtos(hp_ad.datum))

$$ : this is the problem-spot: append blank is always executed, but the replace command fails, sometimes. But: if you open the table with order 'consol' this record is shown in the sequence on the place it would have to have had when the fields 'dag', 'project' and 'xsysnr' were replaced normally. My conclusion is: the index was updated but the fields not, because they are empty...

*append blank
* if rlock()
* replace dag with hp_ad.datum,;
* project with hp_ad.prj,;
* xsysnr with hp_ad.xsysnr
* unlock
* endif
* sele pers
* if seek(hp_ad.xsysnr)
* sele consol
* if rlock()
* replace naam_op with alltrim(pers.naam)+ ', ' + alltrim(pers.vnaam)
* unlock
* endif
* endif
*sele consol

** plaats in pers op juiste
sele pers
seek(hp_ad.xsysnr)

sele consol
insert into consol (dag,project,xsysnr,naam_op);
values (hp_ad.datum,hp_ad.prj,hp_ad.xsysnr,alltrim(pers.naam)+ ', ' + alltrim(pers.vnaam))


endif


Best regards
Ivo
Ivo HUBERT
G.S.P. n.v., Development dep.
Antwerp
Belgium
ivo.hubert@skynet.be
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform