nosuchmodel


Information

Created with NetLogo version NetLogo 3.0.2
Running with NetLogoLite.jar version 302.


WHAT IS IT?


-------
This is a model that is displayed when a mode-run request is made where the model name in the URL is not a model that can be found on the server. Instead of a special error message, or (far worse) a PHP runtime error screen, I thought it would be amusing to simply display a special model, just for this situation. Thus: nosuchmodel.nlogo

HOW DOES IT WORK?


-------------
The scrolling message is started automatically using the "startup" procedure. The startup procedure, if it exists, is always run when a NetLogo model loads.

Procedures

NetLogo Version: NetLogo 3.0.2

;;;; SUMMARY
;; This is the model that is shown when an invalid model name is requested--your bookmark may be out of date!
;;;; COPYRIGHT
;; Copyright (C) 2005 James P. Steiner
;; 
;; 
;; 
globals
[ marq-go?
  marq-row
  marq-text
  marq-speed
  marq-len
]



to startup
   ca
   ask random-n-of 25 patches
   [ sprout 1
     [ set shape "blank"
       set label "?"
     ]
   ]
   marquee-start
      "Greetings From TurtleZERO.com! The requested model does not exist, or may have been updated. Please check the models menu for your model!"
      0 ;; row
      .1 ;; speed
end  
  
to go
   set marq-go? false
end

;; 
;;
;; TURTLE ZERO WEB APPLET FUNCTIONS
;;


    
to marquee-start [ marq-text-in  marq-row-in  marq-speed-in ]
   set marq-go? true
   set marq-text marq-text-in
   set marq-row-in int marq-row-in
   set marq-row patches with [ pycor = marq-row-in ]
   set marq-speed marq-speed-in
   let num 0
   set marq-len length marq-text + screen-size-x
   ask marq-row [ set plabel-color YELLOW ]
   while [ marq-go? = true ]
   [ marquee-frame num 
     wait marq-speed
     set num num + 1
     if num = marq-len [ set num 0 ]
   
  ]
  if ( marq-go? = false )
  [ marquee-frame -1 ]
end

to marquee-frame [ num ]
   let col-off (- screen-edge-x )
   let l length marq-text
    ask marq-row
    [ let char pxcor + col-off + num
      ifelse char < 0 or char >= l 
      [ set plabel no-label
      ]
      [ set plabel substring marq-text char (char + 1)
      ]
    ]
  marquee-animation
   display
end
   
to marquee-animation
   ask turtles
   [ jump .2
     rt 5
   ]
end   

                    


Download Link

View or download the complete model file (to download: right-click, save-link-as):
-- Download nosuchmodel --