home *** CD-ROM | disk | FTP | other *** search
- /* CMD: Next Empty Layer
- *
- * Set foreground layers to next empty layer. If it starts on a full layer,
- * we go to the first empty. If current layer is already empty, we go to
- * next empty one.
- */
-
- SIGNAL ON ERROR
- SIGNAL ON SYNTAX
-
- libadd = addlib("LWModelerARexx.port",0)
- call main
- if (libadd) then call remlib("LWModelerARexx.port")
- exit
-
-
- main:
-
- emp = emptylayers()
- if (words(emp) = 0) then return
-
- cur = curlayer()
-
- /* Find highest empty layer in cur
- */
- cur1 = 0
- do i=1 to words(cur)
- l = word(cur,i)
- if (pos(l, emp) ~= 0) then cur1 = l
- end i
-
- /* Find next higher empty layer, or first empty layer if none
- */
- do i=1 to words(emp)
- l = word(emp,i)
- if (l > cur1) then do
- call setlayer l
- return
- end
- end i
-
- call setlayer word(emp,1)
- return
-
-
- SYNTAX:
- ERROR:
- t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
- if (libadd) then call remlib("LWModelerARexx.port")
- exit
-