home *** CD-ROM | disk | FTP | other *** search
- /* CloneItem - clones the Initiator() item from 'clone list 1' to
- 'clone list 2' or vice versa. This is used in the ARexx commands
- hyperbook as part of the demonstration of the clone() function.
- */
-
- call searchstart(':')
- list1 = searchname('clone list 1')
-
- call searchstart(':')
- list2 = searchname('clone list 2')
-
- init = initiator()
-
- launch_ok = 1
-
- if length(init) == 0 then do
- launch_ok = 0
- say failed 1
- end
- else do
- if gettype(init) ~= 'Item' then do
- launch_ok = 0
- say failed 2
- end
- end
-
- if launch_ok == 0 then do
- say 'This macro must be launched from a list item.'
- say 'The initiator was:' init
- EXIT
- end
-
- plist = parent(init)
-
- if plist == list1 then call clone(init, list2)
- else do
-
- if plist == list2 then call clone(init, list1)
- else say 'Use this macro with the two lists on the ''clone'' page.'
- end
-