vendredi 26 janvier 2018

Multiples If statements Errror VBS

Well, I am trying to create a program with VBScript and i am getting this Error. Actually i want one Big IF statement that includes more if statements inside. I am using NotePad++ and i am trying to make them in order but nothing happens. When i open an if statement i close it again. Look at these images.

The Message Error: http://prntscr.com/i5vu2s

The Code (To help you more)

Dim Pounds,Dest,Charge,Results

Pounds=InputBox("How many pounds is your letter?","Jim's Corporation")

Dest=InputBox("Where would you like to send it?",vbNewLine,"Answer with (Abroad) or (Inside)","Jim's Corporation")

If Dest = "Inside" then

If Pounds <= 500 then

Charge = 2

Else If Pounds <= 1000 then

Charge = 3.5

Else If Pounds <= 2000 then

Charge = 4.6

Else

Error_1=msgbox("Please Select a value between 0-2.000","Jim's Corporation")

`End If

Else If Dest= "Abroad" then 'Unnecessary

If Pounds <= 500 then

Charge = 4.8

Else If Pounds <= 1000 then

Charge = 7.2

Else If Pounds <= 2000 then

Charge = 11.5

Else

Error_1=msgbox("Please Select a value between 0-2.000","Jim's Corporation")

End If

End If

Results=MsgBox("The Charge is "& Charge,0,"Jim' Corporation")

Aucun commentaire:

Enregistrer un commentaire