Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alais not found
Message
De
13/07/2000 11:30:15
 
 
À
12/07/2000 17:44:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00391428
Message ID:
00391847
Vues:
10
Hi John,
I'll be glad to give you my opinion, but up front I'll tell ya, Im not a Guru. As for if your algorithm is logically correct, I'd have to know more detail about what is stored in the tables and how it's organized.

>Jon,
>
>What I'm trying to do is post transactions to a history table, and at the same time stop the possiblity of
>posting the same info twice. Am I going about it the right way ? Could you take a look at the following code ?
>
>John
>
>LOCAL loProgBar
>
>SET STEP ON
>SET PATH TO \EFG
>SET STATUS OFF
>USE \EFG\HIST IN 0
>USE \EFG\PAY IN 0


>** SET FILTER TO GROUP_CODE = "A01" AND INS_CO_NAM = "AMERICAN UNITED LIFE"
>IF PAY.PAIDDATE == HIST.PAIDDATE .AND. PAY.GROUP_CODE==HIST.GROUP_CODE .AND. PAY.INS_CO_NAM = HIST.INS_CO_NAM


>MESSAGEBOX("THIS PAID DATE HAS BEEN POSTED, PLEASE TRY AGAIN.")
> ELSE
> USE \EFG\PAY IN 0
> SELECT PAY
>loProgBar=ProgBar()
> SCAN
> loProgBar.npercent=RECCOUNT()/RECCOUNT()*100
> SCATTER MEMVAR MEMO
> INSERT INTO HIST FROM MEMVAR
> ENDSCAN
> ENDIF
> SET FILTER TO
> *** CLOSE ALL
> RETURN

Here's how I would do it:
LOCAL loProgBar

SET STEP ON
SET PATH TO \EFG
SET STATUS OFF
USE \EFG\HIST IN 0
USE \EFG\PAY IN 0

SCAN
  loProgBar=ProgBar() && assuming ProgBar() returns an obj. ref. to progress bar
  loProgBar.npercent=RECNO()/RECCOUNT()
  SELECT HIST
  LOCATE FOR HIST.PAIDDATE == PAY.PAIDDATE .AND. HIST.GROUP_CODE ==;
    PAY.GROUP_CODE .AND. HIST.INS_CO_NAM == PAY.INS_CO_NAM
  IF FOUND()
    MESSAGEBOX("THIS PAID DATE HAS BEEN POSTED, PLEASE TRY AGAIN.")
  ELSE
    SELECT PAY
    SCATTER MEMVAR MEMO
    SELECT HIST
    APPEND BLANK
    GATHER MEMVAR MEMO
  ENDIF
  SELECT PAY
ENDSCAN
> SET FILTER TO
> *** CLOSE ALL
> RETURN

Just my .02

Jon
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform