How to text if any array fields are null...and stop execution

All-

  1. Is there a quick way to any of several array fields are null?

Pseudo: If field[1] or field[2] or field[3] or field[4] or field[5] == ""
do something
end

  1. Also, what’s the programmatic way to bail from a program. Is it just a line that says “quit” or something? (In the present case, if any of the fields in #1 above are null, I want to stop the program.

Thanks!

-k euler

Hi,

···

At Tue, 23 Jul 2002 14:41:39 +0900, Kurt Euler wrote:

  1. Is there a quick way to any of several array fields are null?

Pseudo: If field[1] or field[2] or field[3] or field[4] or field[5] == “”
do something
end

  1. Also, what’s the programmatic way to bail from a
    program. Is it just a line that says “quit” or something? (In
    the present case, if any of the fields in #1 above are null,
    I want to stop the program.

if field[1…5].find {|f| f == “”}
exit
end


Nobu Nakada

Hi,

“Kurt Euler” keuler@portal.com wrote in message
news:C47CCC6238EFD4119C5200508B95A100074AF882@cup1ex1.portal.com

All-

  1. Is there a quick way to any of several array fields are null?

Pseudo: If field[1] or field[2] or field[3] or field[4] or field[5] == “”
do something
end

  1. Also, what’s the programmatic way to bail from a program. Is it just a
    line that says “quit” or something? (In the present case, if any of the
    fields in #1 above are null, I want to stop the program.

puts “abort” or exit if field.indexes(1,2,3,4,5).include?(“”)

Thanks!

-k euler

Park Heesob