Hi there,
I've picked up Rev today after a while and started a new app.
I noticed how it amused me again but there is still one thing I don't
understand: I have repeating code and I don't know how to shorten it.
In my app I will use 25 fields and they need to be checked:
--field "naam1"
if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "1"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"
 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "2"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"
 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "3"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"
 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "4"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"
 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "5"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"
 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "6"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"
 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "7"
 then answer error "Naam van leerling 1 mag niet leeg zijn!"

 if the text of field "naam1" is not empty and the selectedtext of
button "naam1nivo" = "..."
 then answer error "Niveau van leerling 1 mag niet leeg zijn!"

 if the text of field "naam1" = empty and the selectedtext of button
"naam1nivo" = "..."
 then put "" into tData
 else put field "naam1" && the selection of button "naam1nivo" &cr into tData

So can anyone help to shorten the code (because I have 25 fields)?

Greetings from a cold but sunny Holland,

William de Smet
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to