Jump to content
  • 0

Verschillende scriptvolgorde met zelfde resultaat ?


VWin

Question

Hallo, 

leiden beide scriptjes tot hetzelfde resultaat ?

A)

if ("condition" = x)

       interrupt script for 3 seconds

end if

do script  "print whatever"

 

B)

if ("condition" = x)

       interrupt script for 3 seconds

else do script  "print whatever"

end if

Link to comment

5 answers to this question

Recommended Posts

  • 0

Hallo,

mijn "twijfel"geval was niet helemaal correct weergegeven. Mijn excuses. Had moeten zijn: 

A)

if ("condition" = x)

       interrupt script for 3 seconds

end if

do script  "print whatever"

 

B)

if ("condition" = x)

       interrupt script for 3 seconds

      do script  "print whatever"

else

      do script  "print whatever"

end if

Link to comment
  • 0
16 hours ago, Paul Sondervan said:

A is netter en daarom aan te raden. 

Daarover kun je van mening verschillen. B is duidelijker; er staat expliciet wat er gebeurt wanneer er aan de conditie wordt voldaan én wanneer daar niet aan wordt voldaan. Speciaal wanneer er nogal wat scriptregels tussen zitten kan het m.i. geen kwaad om zo de leesbaarheid te verbeteren en daarmee het onderhoud makkelijker te maken.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...