Hi Michelle,

Have you tried putting each condition in it's own 'IF' statement.??  Also, you did a 
good job of waiting or putting a 'stable' your code to allow MEDITECH to catch up... 
but in your condition statements, I didn't see any.  This could be why you are getting 
inconsistent results.

Let me know if I can help any more.  And... Tell Charlotte I said hello.. :)

Vince Swisher
Lahey Clinic


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Barker, Michelle
Sent: Monday, November 10, 2003 2:00 PM
To: [EMAIL PROTECTED] COM (E-mail)
Subject: [Talk] inconsistent If/Else


Hi 
I have a script that reads from a list of employees and writes their
allowance amounts to the employee's timecard. I need to evaluate two things:


1. If the script gets an "Employee Terminated" warning and 
2. If the employee doesn't have a timecard (no Ctrl Hours posted)

I have written an If/Else statement that firsts looks for the warning:  If
At ("[EMAIL PROTECTED],1) Then..... do some stuff and go on to the next employee.
If there is no warning it next looks for a blank Ctrl Hour field:  ElseIf
Trim(View(2, 1, 3)) = "" Then.... do some different stuff and go on to the
next employee.
Finally, if everything is okay it writes the allowance value to the
timecard:    Else Tab_ ""  ... and do more stuff and go onto the next
employee.

The script is very inconsistent when it runs. Sometimes it goes to the
correct If statement and sometimes it doesn't. In my test population I had
one employee with no timecard and it put allowances on the card. Another had
hours and it evaluated it as no timecard. The one that it stumbles over the
most is when an employee has been termed it goes to the Else statement and
trys to put allowances on the card. 

When I originally wrote this script I didn't have the "Termed" condition in
it, and I still had a lot of problems getting the script to evaluate the
Ctrl Hour field for consecutive employees. I added a Key "@_CLEAR" before
the Do Until loop and that seemed to fix it. I've tried added another one
just before the script enters the employee's ID. It's still inconsistent.
I've only been able to get the script to run correctly through my entire
test population of 12 employees once. 

Attached are the script, the source file, and the exception file from a
successful run. Any suggestions are welcome. 
Okay, I'm really just looking to do the least amount of QA at the end of the
script as I have to!

Thanks

Michelle Barker

617-665-3432
Clinical Application Analyst
CHA Information Technology
[EMAIL PROTECTED]


 <<TimecardScript.txt>>  <<EmployeeList.prn>>  <<ExceptionTCH.txt>> 


See our web page at http://www.lahey.org for a full directory of Lahey sites, staff, 
services and career opportunities.

THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY 
CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER 
APPLICABLE LAW. If you are not the intended recipient, your use of this message for 
any purpose is strictly prohibited. If you have received this communication in error, 
please delete the message and notify the sender so that we may correct our records.

Reply via email to