Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate number
Message
From
15/01/2005 15:08:18
 
 
To
15/01/2005 13:25:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00977470
Message ID:
00977499
Views:
33
hi,
thanks again,
i get the idea from your code,
i write this code under,it works,if you have newway to writ it ,it is welcome
if  thisform.text1.value =< 2000
    thisform.text2.value      = thisform.text1.value * 0.05
else
    if  thisform.text1.value =< 30000
        n1          = 2000*0.05 && mean 100
                m.a1=thisform.text1.value-2000
        ? n1,m.a1
        endif
        
        if m.a1>0 and m.a1>4000
            n2          = 4000*0.10 && mean 400
         else
            n2          = m.a1*0.10 && mean 400
        endif
        ? n2
        
        m.a2=m.a1-(4000)
        if m.a2<=0 
        n3=0
        else
      
        if  m.a2>8000
        n3          = 8000*0.20 && mean 1600
      
        else
        n3          = m.a2*0.20 && mean 1600
        
     
        endif
     
        endif
        ? n3
        m.a3=m.a2-(8000)
              if m.a3<=0
              n4=0
              else
              if m.a3>16000 
        n4          = 16000*0.25 && mean 4000
        ? n4
        else
        n4          = m.a3*0.25 && mean 4000
        
        ? n4,m.a3
        
  endif
     

    endif
endif
  thisform.text2.value   = n1 + n2 + n3 + n4
best regards.

>>thanks,
>
>you're welcome
>
>>but i need somthing else as subtract the first 2000 at step1,subtract 4000 at second .....etc,e.i if mynumber after the 2 steps is=0 sum n1+n2,if mynumber after 3 steps=0 sum n1+n2+n3....
>
>Well, maybe I didn't got you fine.. Can you be a little more "procedural".. Taking step-by-step..
>
>
>if  thisform.text1.value =< 2000
>    thisform.text2.value      = 2000 - (thisform.text1.value * 0.05)
>else
>    if  thisform.text1.value =< 30000
>        n1          = 2000*0.05 && mean 100
>        &&& i mean now 30000-2000
>        n2          = 4000*0.10 && mean 400
>        &&& 28000-4000
>        n3          = 8000*0.20 && mean 1600
>        &&&&24000-8000
>        n4          = 16000*0.25 && mean 4000
>        thisform.text2.value   = iif((n1+n2+n3+n4)>0,4000 - (n1 + n2 + n3 + n4), n1 + n2 + n3 + n4)
>    else
>        * your number is greaterthan 30000
>    endif
>endif
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform