Loading...
 

return

return

return
With the InstantView command return the current procedure/message is immediately exited. The stack is not changed by the command.

Define(CheckSlotsCosts)
  Var(tmpObject, hasNoCosts, vessel, slotName)
  TRUE -> hasNoCosts
  -> tmpObject
  allSlots iterate(UNSAFE)
  {
    -> vessel
    // Only .capturedCosts-slot
   
vessel Copy(Name()) Dup -> slotName

    ".capturedCosts" StringFind ifnot

    {

      slotName ".jobTime" StringFind ifnot continue // Continue the iteration now!

    }
    tmpObject slotName Copy(STACK) Call(IsZero) ifnot { FALSE -> hasNoCosts break } // Break the iteration now!


  }
  hasNoCosts if { T("Hat keine Kosten!", "Has no costs!") return } // Leave procedure now!

  T("Übergebene Position hat Kosten!", "Given object has costs!")
;

 

Attention: In iterate loops (as in the example) return always leaves the enclosing procedure/message. But if the (outdated) variant iterate(PROCEDURE) is used, then return leaves only the procedure itself and has the same effect as continue in a regular iterate loop.

See also

More examples