Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using objects to capture multiple TRUE condition results
Message
 
 
To
01/11/2006 10:19:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01166162
Message ID:
01166432
Views:
12
Hi Gil,

Did your Caps Lock key stuck when you typed your program? <g>

>I'm trying to create a file that records value changes to more than one field by using an object. The code below is being used instead of a CASE statement because I discovered that after the first TRUE condition is encountered, all other CASE conditions that return a value of TRUE are ignored.
>
>THE PROBLEM is that the values are copied to the object file when the first IF condition is TRUE, but the SCATTER command is not working to retrieve the values if the second (or third, etc.) IF condition is TRUE. Any assistance that can be offered to resolve this would really be appreciated.
>
>
>PROC UPDTCAMPAIGN
>
>SELE CURRDATA
>CLOSE INDE
>
>SELE Edcpgntmpl
>PACK && REMOVES RECORDS DELETED TO TO ERROR VALIDATIONS
>INDE ON SCID TAG SCID
>
>SELE CURRDATA
>IF RECCOUNT() = 0
>    APPE FROM EDCPGNTMPL
>ELSE
>    SCATTER FIELDS BRAND,SCID,BOUNCES,OPENS,TOTALCLICKS,UNIQUECLICKS,;
>    OPTOUTS,TOTALMAILED,NETMAILED NAME UPDRECS BLANK
>    STORE " " TO LCUPDT
>    STORE 0 TO LNUPDREC
>    1
>    SCAN
>       STORE SCID TO LNSCID
>       IF SEEK(LNSCID,'EDCPGNTMPL')
>
>	 IF BOUNCES <> EDCPGNTMPL.BOUNCES
>	    REPL BOUNCES WITH EDCPGNTMPL.BOUNCES
>	    SCATTER FIELDS BRAND,SCID,BOUNCES NAME UPDRECS ADDI
>	    DO RECORDUPDATES
>	    LCUPDT= "Y"
>	 ELSE
>	    LCUPDT= ""
>	 ENDIF
>
>          IF OPENS <> EDCPGNTMPL.OPENS
>	    REPL OPENS WITH EDCPGNTMPL.OPENS
>	    SCATTER FIELDS BRAND,SCID,OPENS NAME UPDRECS ADDI
>	    DO RECORDUPDATES
>	    LCUPDT= "Y"
>          ELSE
>	    LCUPDT= ""
>          ENDIF
>
>       ENDIF
>
>       IF !EMPT(LCUPDT)
>          LNUPDREC= LNUPDREC+1
>       ENDIF
>    ENDSCAN
>
>WAIT WIND ALLT(STR(LNUPDREC))+" RECORD(S) WERE UPDATED IN THE CAMPAIGN MASTER FILE" TIME 1
>ENDIF
>
>ENDPROC
>
>********************************************************
>
>PROC RECORDUPDATES
>
>IF USED('CAMPAIGNUPDATES')
>	SELE CAMPAIGNUPDATES
>ELSE
>	USE CAMPAIGNUPDATES IN 0 EXCL
>	SELE CAMPAIGNUPDATES
>ENDIF
>APPEND BLANK
>GATHER NAME UPDRECS
>REPL ALL DATE WITH DATE() FOR EMPT(DATE)
>REPL ALL FILEDATE WITH VAL(PCFILENAME) FOR EMPT(FILEDATE)
>
>ENDPROC
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform