home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************/
- /* */
- /* Cut off local module and save as external module */
- /* */
- /* Place the cursor somewhere inside the internal module */
- /* you want to save as an external module. The module will */
- /* be saved in the file Modules/modulename.mod and if */
- /* success it will be cut off the program text. */
- /* */
- /* The operation is done by marking the module as a block */
- /* which is saved by using the script file SaveBlock.iplc */
- /* */
- /****************************************************************/
-
- OPTIONS RESULTS
- 'COMALPATH'
- ComalDir = RESULT
-
- DO FOREVER
- OPTIONS RESULTS
- 'GETTEXT'
- Line = RESULT
- IF ( SUBSTR(Line,1,6)=='MODULE' ) THEN BREAK
- OPTIONS
- 'CURSOR UP'
- IF RC>0 THEN BREAK
- END
-
- IF ( SUBSTR(Line,1,6)=='MODULE' )
- THEN DO
- File = ComalDir || 'Modules/' || SUBSTR(Line,8,LENGTH(Line)-7) || '.mod'
- num = 1
- 'BLOCK'
- DO FOREVER
- num = num + 1
- IF ( SUBSTR(Line,1,9)=='ENDMODULE' ) THEN BREAK
- 'CURSOR DOWN'
- IF RC>0 THEN BREAK
- OPTIONS RESULTS
- 'GETTEXT'
- Line = RESULT
- END
- IF ( SUBSTR(Line,1,9)=='ENDMODULE' )
- THEN DO
- 'SAVEBLOCK' File
- DO num
- 'DELLINE'
- 'CURSOR UP'
- END
- END
- ELSE DO
- 'BLOCK'
- WRITESTATUS 'ENDMODULE missing'
- END
- END
- ELSE DO
- OPTIONS
- WRITESTATUS 'Not inside MODULE'
- END
-