home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / ude.tcl < prev    next >
Text File  |  1996-08-23  |  2KB  |  94 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1995
  4. #
  5. #      File:           @(#)ude.tcl    /main/hindenburg/2
  6. #      Author:         Fred Mol
  7. #      Description:    main ude.tcl
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)ude.tcl    /main/hindenburg/2    23 Aug 1996Copyright 1995 Westmount Technology
  10.  
  11. OtkRegister::extGui
  12.  
  13. source [m4_path_name tcl libocl.tcl]
  14.  
  15. require platform.tcl
  16. require procs.tcl
  17. require messagehdl.tcl
  18.  
  19. proc usage {} {
  20.     error "Usage: otk ude.tcl -- \
  21.         \[-c caller\] \
  22.         \[-r\] \
  23.         fileVersionId systemVersionId configVersionId"
  24. }
  25.  
  26. set argc 0
  27. set status INITIAL
  28. set readOnly 0
  29. set caller ""
  30. foreach arg $argv {
  31.     case $arg in {
  32.         {-c} {
  33.         if {$status != "INITIAL"} {
  34.             usage
  35.         }
  36.         set status CALLER
  37.         }
  38.         {-r} {
  39.         if {$status != "INITIAL"} {
  40.             usage
  41.         }
  42.         set readOnly 1
  43.         }
  44.         {default} {
  45.         case $status in {
  46.             {CALLER} {
  47.             set caller $arg
  48.             set status INITIAL
  49.             }
  50.             {INITIAL} {
  51.             if [catch {set fv [Graph new $arg]}] {
  52.                 usage
  53.             }
  54.             set status GRAPH
  55.             }
  56.             {GRAPH} {
  57.             if [catch {set sv [SystemVersion new $arg]}] {
  58.                 usage
  59.             }
  60.             set status SYSV
  61.             }
  62.             {SYSV} {
  63.             if [catch {set cv [ConfigVersion new $arg]}] {
  64.                 usage
  65.             }
  66.             set status CONFV
  67.             }
  68.             {default} {
  69.             usage
  70.             }
  71.         }
  72.         }
  73.     }
  74.     incr argc 1
  75. }
  76. if {$status != "CONFV"} {
  77.     usage
  78. }
  79.  
  80. set type [[$fv file] type]
  81. require "${type}editor.tcl"
  82.  
  83. sourceOptional u_ude
  84.  
  85. [string toupper $type]Editor new .main \
  86.     -systemVersion $sv \
  87.     -configVersion $cv \
  88.     -permanentReadOnly $readOnly \
  89.     -caller "$caller" \
  90.     -firstExposed ".main startEdit $fv"
  91.  
  92. .main popUp
  93. .main ready
  94.