[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Set priorities



hi everyone!
I have to write a flat file with e-mail addresses, and I have to select the
employee's work e-mail, if not available, select home e-mail, if not select
other1, if not other2, and if not other3, and if not nothing. I only want
one e-mail, and the priority is the one listed above. Some employees have
different e-mail addresses, some only one, etc.
I don't know how to do it. Everything I've tried has failed.
I have tried evaluating the field, since it has different translate values,
also nested if statements, writing a different procedure for each e-mail
type... all sorts of things, and nothing works. It's like for some reason it
can't get the variables.
This is one of the things I tried - the different procedures:
!*************************************
Begin-Procedure Check-email-work
!*************************************
if $emailtype <> 'E-MW'
do check-email-home
else
let $emailtype = 'E-MW'
end-if
end-procedure check-email-work
!*************************************
Begin-Procedure Check-email-home
!*************************************
if $emailtype <> 'E-MH'
do check-email-O1
else
let $emailtype = 'E-MH'
end-if
end-procedure check-email-home
!*************************************
Begin-Procedure Check-email-O1
!*************************************
if $emailtype <> 'E-O1'
do check-email-O2
else
let $emailtype = 'E-O1'
end-if
end-procedure check-email-O1
!*************************************
Begin-Procedure Check-email-O2
!*************************************
if $emailtype <> 'E-O2'
do check-email-O3
else
let $emailtype = 'E-O2'
end-if
end-procedure check-email-O2
!*************************************
Begin-Procedure Check-email-O3
!*************************************
if $emailtype <> 'E-O3'
let $email = ' '
end-if
end-procedure check-email-O3
And this is the last thing I have tried:
Begin-procedure check-email-type
if &b.t2_e_addr_type = 'E-MW'
let $work = &b.t2_e_addr_type
print $work
else
if &b.t2_e_addr_type = 'E-MW'
let $home = &b.t2_e_addr_type
print $home
else
if &b.t2_e_addr_type = 'E-O1'
let $other1 = &b.t2_e_addr_type
print $other1
else
if &b.t2_e_addr_type = 'E-O2'
let $other2 = &b.t2_e_addr_type
print $other2
else
if &b.t2_e_addr_type
let $other3 = &b.t2_e_addr_type
print $other3
end-if
end-if
end-if
end-if
end-if
Hope you can help me out!
Thanks a bunch in advance!
laura.