We help IT Professionals succeed at work.

Problem with Expected 'Wend'

admjeno
admjeno asked
on
Medium Priority
544 Views
Last Modified: 2012-08-14
Hi i'm new to asp code!

I need some help with a line!
i'm trying to use 5 lines with different pictures into it. if its solved, picture good or if its bad, picture bad!
the problem i have is that its complaining about "wend"
how can i write this without getting the wend message??

if fldstatus > good then fldpicture1 = "<img src=""images/good.gif "">" 
elseif fldstatus > normal then fldpicture1 = "<img src=""images/normal.gif "">"

Error Type:
Microsoft VBScript compilation (0x800A03FA)
Expected 'Wend'


please help an old technician
Comment
Watch Question

Commented:
There needs to be an endif at the end. Try to rewrite it to something like this:

if fldstatus > good then
  fldpicture1 = "<img src=""images/good.gif "">" 
elseif
  fldstatus > normal then fldpicture1 = "<img src=""images/normal.gif "">"
endif

ASP works in code blocks which you always need to end. It's not like php or C in that manner. There are no 1-line blocks.
Technology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013
Commented:
To know exactly what's going on, we need more information than that - you don't even have the while statement listed.

Though I assume "good" and "normal" are numeric values?

Also, Elseif is not used that way, it should look more like this:

if fldstatus > good then
    fldpicture1 = "<img src=""images/good.gif "">" 
elseif fldstatus > normal then
    fldpicture1 = "<img src=""images/normal.gif "">"
End if

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Yes thats right! i'm using numeric values!
Is it something else i have to think about?
Thanks for your help!
Lee W, MVPTechnology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013

Commented:
Like I said, more of your code would help answer the question and as we both said, your if statement needs to be modified.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.