| View previous topic :: View next topic |
| Author |
Message |
pozzwali Newbie
Joined: 04 Jun 2004 Posts: 4
|
Posted: Fri Jun 04, 2004 8:53 pm Post subject: IF statements |
|
|
I am trying to write an IF/ELSE Statement basically I have variable N
If N is equal to 1,2,3... then I need that value matched to another variable
%S = @INPUT(Please enter you Store Number)
IF %S = 1
%N = Downtown
END
IF %S = 2
%N = DT2
END
I gues I am using the IF function in correctly because if you input 1 as the store number the variable %N still shows up as DT2 instead of Downtown
Any help would be appreciated.
pozz
________
Mercedes-Benz C291 history
Last edited by pozzwali on Tue Feb 01, 2011 4:11 am; edited 1 time in total |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Jun 04, 2004 11:32 pm Post subject: |
|
|
Welcome Pozzwali,
Let me help you with the big bad IF
The code below is for pre VDS 5.x
| Code: |
%S = @INPUT(Please enter you Store Number)
IF @Equal(%S,1)
%N = Downtown
Else
If @Equal(%S,2)
%N = DT2
Else
%N = ERROR
End
End
|
The code below is for VDS 5.x and newer
| Code: |
%S = @INPUT(Please enter you Store Number)
IF @Equal(%S,1)
%N = Downtown
ElsIF @Equal(%S,2)
%N = DT2
Else
%N = ERROR
End
|
Have fun... _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Jun 05, 2004 11:08 am Post subject: |
|
|
Hi pozzwali, and welcome to the forums
I advice you to get used to the elsif statements - with bigger scripts these
statements are much more easier to read and adapt. But you'll have to
be using vds 5, as dragonsphere mentioned above.
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Jun 05, 2004 1:06 pm Post subject: |
|
|
I thought ElsIf was there in VDS 4 too. Maybe my mind is decieveing me.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Jun 05, 2004 7:37 pm Post subject: |
|
|
Yep, it is in VDS 4 also. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Jun 06, 2004 12:56 am Post subject: |
|
|
Oops I have never used VDS 4. I skipped that version. I went from 3.51 to VDS 5.x  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
pozzwali Newbie
Joined: 04 Jun 2004 Posts: 4
|
Posted: Mon Jun 07, 2004 1:49 pm Post subject: |
|
|
Thanks DragonSphere that did the trick
________
drug testing
Last edited by pozzwali on Tue Feb 01, 2011 4:11 am; edited 1 time in total |
|
| Back to top |
|
 |
Protected Valued Contributor


Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Tue Jun 15, 2004 4:34 pm Post subject: |
|
|
There is an ELSIF in VDS 4??? OMG!!! I had never noticed!  |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Tue Jun 15, 2004 6:57 pm Post subject: |
|
|
Whoa! Now it's like a new feature!  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|