Page 1 of 1

Ifex doesn't work like i want

PostPosted: Wed Oct 29, 2014 3:51 am
by fieldhopper
That is the code:
Code: Select all
            Ifex "[zt_giltab]<=[tagesdatumzahl] AND [zt_giltbis] > [tagesdatumzahl]"
                 dbpNext "LEP" "[zschulnr]"
            else
                 If "[zt_giltbis]" "=" "0"
                    dbpNext "LEP" "[zschulnr]"
                 else
                    dbpDeleteRecord "LEP" "[zschulnr]"
                 endif
            endif


Contents of fields:

[tagesdatumzahl] = 42217
[zt_giltab] = 41852
[zt_giltbis] = 42947

On the basis of this contents it should be dbpNext, but the way is the next command If "[zt_giltbis]" "=" "0".

WHY :( .

Re: Ifex doesn't work like i want

PostPosted: Wed Oct 29, 2014 5:31 am
by dec
Hello,

I try your code and works like you expected, that is, executing this code:

Code: Select all
SetVar "[zt_giltab]" "41852"
SetVar "[zt_giltbis]" "42947"
SetVar "[tagesdatumzahl]" "42217"

IfEx "[zt_giltab] <= [tagesdatumzahl] AND [zt_giltbis] > [tagesdatumzahl]"
  AlertBox "Step 1" "Step 1"
Else
  If "[zt_giltbis]" "=" "0"
    AlertBox "Step 2" "Step 2"
  Else
    AlertBox "Step 3" "Step 3"
  EndIf
EndIf


... cause that the "Step 1" alertbox appear. Then, are you sure the variables contains the appropiate values? Something else in your own code (around the extract you shown) can cause the "problem"?

Re: Ifex doesn't work like i want

PostPosted: Thu Oct 30, 2014 1:08 am
by fieldhopper
THX for your help. You have shown me the right way. The mistake is before this code. I found and i'm lucky.

Thanks a lot for your help.

Re: Ifex doesn't work like i want

PostPosted: Thu Oct 30, 2014 1:14 am
by dec
Hello,

fieldhopper wrote:THX for your help. You have shown me the right way. The mistake is before this code. I found and i'm lucky.

Thanks a lot for your help.


You're welcome!