Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF condition
Message
From
11/03/2000 23:42:26
 
 
To
11/03/2000 22:38:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00344657
Message ID:
00344665
Views:
21
Joao,

DO CASE is an alternative to multiple IF statements:
DO CASE
  CASE pnTipoPrcTer=1
    this.parent.LinPrUnit.Value=artigos.n_pvp1
  CASE pnTipoPrcTer=2
    this.parent.LinPrUnit.Value=artigos.n_pvp2
  CASE pnTipoPrcTer=3
    this.parent.LinPrUnit.Value=artigos.n_pvp3
  CASE pnTipoPrcTer=4
    this.parent.LinPrUnit.Value=artigos.n_pvp4
  OTHERWISE
    * the otherwise clause is optional, but can be used to give
    * default code when none of the conditions are met
ENDCASE
You could also build a command string and macro-execute it (this is not tested):
cString=[this.parent.LinPrUnit.Value=artigos.n_pvp]+;
  STR(pnTipoPrcTer,1)
&cString
>if pnTipoPrcTer=1
>this.parent.LinPrUnit.Value=artigos.n_pvp1
>endif
>if pnTipoPrcTer=2
>this.parent.LinPrUnit.Value=artigos.n_pvp2
>endif
>if pnTipoPrcTer=3
>this.parent.LinPrUnit.Value=artigos.n_pvp3
>endif
>if pnTipoPrcTer=4
>this.parent.LinPrUnit.Value=artigos.n_pvp4
>endif
>
>Thank's in Advance
>
>João Batista
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform