×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VBScript getting Expected 'End' error --- HELP

VBScript getting Expected 'End' error --- HELP

VBScript getting Expected 'End' error --- HELP

(OP)
VB Script Error: C:\Users\hrjco\AppData\Local\Adersoft\VbsEdit\Temp\OCDEZEYU.vbs(3, 3) Microsoft VBScript compilation error: Expected 'End'
Purpose of script: I'm essentially trying to see if variable GetDocALIAS = "A587" then the variable GetDOCTYPE will be stored as Doc1, if it's not A587, and it's A588, then GetDOCTYPE will be Doc2, etc etc.

What am I missing here? HELP!!!

Function GetDOCTYPE(text)
IF GetDOCALIAS = "A586" then GetDOCTYPE = "Colonoscopy Orders"
Else GetDOCALIAS = "A587" then GetDOCTYPE = "Ercp Orders"
ElseIF GetDOCALIAS = "A588" then GetDOCTYPE = "Flex Sigmoidoscopy Orders"
ElseIF GetDOCALIAS = "A589" then GetDOCTYPE = "Peg Orders"
ElseIF GetDOCALIAS = "A590" then GetDOCTYPE = "Upper Endoscopy Orders"
END IF
End Function

RE: VBScript getting Expected 'End' error --- HELP

Hi,

CODE

Function GetDOCTYPE(text)
IF GetDOCALIAS = "A586" then GetDOCTYPE = "Colonoscopy Orders"
ElseIF GetDOCALIAS = "A587" then GetDOCTYPE = "Ercp Orders"
ElseIF GetDOCALIAS = "A588" then GetDOCTYPE = "Flex Sigmoidoscopy Orders"
ElseIF GetDOCALIAS = "A589" then GetDOCTYPE = "Peg Orders"
ElseIF GetDOCALIAS = "A590" then GetDOCTYPE = "Upper Endoscopy Orders"
END IF 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBScript getting Expected 'End' error --- HELP

(OP)
Wow! Totally Awesome! Makes sense...it's the little stuff! What do you think about the below? Getting the same Expected End. From what I can see, everything is good. Essentially I'm taking a date like 05181984 and making it 05/18/1984.

Function ReformatDOS(YMD)
ReformatDOS = Mid(YMD,1,2) & "/" & Mid(YMD,3,2) & "/" Mid(YMD,5,4)
End Function

RE: VBScript getting Expected 'End' error --- HELP

CODE

Function ReformatDOS(YMD)
ReformatDOS = Mid(YMD,1,2) & "/" & Mid(YMD,3,2) & "/" & Mid(YMD,5,4)
End Function 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBScript getting Expected 'End' error --- HELP

(OP)
So looks like I didn't need to change.

RE: VBScript getting Expected 'End' error --- HELP

You missed a concatenation operator.

BTW, I like this better

CODE

Function GetDOCTYPE(text)
Select Case GetDOCALIAS
    Case "A586": GetDOCTYPE = "Colonoscopy Orders"
    Case "A587": GetDOCTYPE = "Ercp Orders"
    Case "A588": GetDOCTYPE = "Flex Sigmoidoscopy Orders"
    Case "A589": GetDOCTYPE = "Peg Orders"
    Case "A590": GetDOCTYPE = "Upper Endoscopy Orders"
End Select 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBScript getting Expected 'End' error --- HELP

(OP)
Dang It! I was so sleepy! I gotcha...on both! So awesome! I need to get to learning this better! I appreciate all of your help!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close