home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / OS / CONIX1.LBR / PROFILE.XCC < prev    next >
Text File  |  2000-06-30  |  3KB  |  98 lines

  1. #
  2. #    PROFILE V22.12a - Start-Up Command Profile for Shareware System
  3. #              Reads default settings from PROFILE.SET file
  4. #              as manipulated by MENU Pull-Down Menu System
  5. #
  6. #    Copyright (C) 1986, Computer Helper Industries Inc.
  7. #    All rights reserved worldwide.
  8. #
  9.  
  10. : profile
  11.  
  12. # dimension variables
  13. #dim filbuf(3840), chain_str(256), fpos(32), linctr(224), comstr
  14. #dim startstr="Welcome to ConIX System/One!"
  15.  
  16. # Disable user interrupts
  17. onint -
  18. pipe
  19.  
  20. ConIX Shareware Version #0986SC
  21. Copyright (C) 1986, Computer Helper Industries Inc.
  22.  
  23. Thank you for trying our ConIX Software.  If you would like to
  24. register your copy and receive the latest complete version of our
  25. Operating System, please contact us at Post Office Box 680, 
  26. Parkchester Station, NY 10462.
  27.  
  28. !
  29. # We said our mind, re-enable interrupts
  30. onint +
  31.  
  32. # trap any errors
  33. trap fatal
  34. # check if the settings file exists
  35. if - find $%d:$%u/profile.set > :nul; then
  36.     # no, create it
  37.     echo "#STARTUP; echo \"{startstr}\"" > profile.set
  38.     # announce its creation
  39.     echo "Configuration file PROFILE.SET not found - initialized on $%D:$%U/."
  40. endif
  41. # read startup file
  42. type profile.set > @{filbuf}-{{filbuf}}
  43. # make sure we didn't overflow
  44. if test &$%M &{{filbuf}}; then
  45.     echo "$%D:$%U/PROFILE.SET too large or incorrect - aborting."
  46.     exit 1
  47. endif
  48. # init saved startup chain string
  49. echo \\ > @{chain_str}
  50. # init place counter
  51. zap {fpos} 00 01
  52. # init line counter
  53. echo 0\\ > @{linctr}
  54. # loop through entries
  55. while type <[k={fpos},p={fpos},n=1] @{filbuf}-{{filbuf}} > @; scmp "$@" "<>" ""
  56. do
  57.     # increment counter
  58.     sum $@{linctr} 1 > @{linctr}
  59.     # check if entry starts as a comment
  60.     if index # "$@" > :nul; then
  61.         # yes, save comment
  62.         parg 1 $@ > @{comstr}
  63.         # some internal mechanism for MENU
  64.         # strip the comment
  65.         index " " "$@" > :nul
  66.         substr &$$0 255 "$@" > @
  67.         # check if startup command
  68.         if scmp "$@{comstr}" = "#STARTUP;"; then
  69.             # yes, save it for later - we will chain
  70.             # to this sequence when done
  71.             echo "$@\\" > @{chain_str}
  72.             continue
  73.         endif
  74.     endif
  75.     # here, execute command in $@
  76.     [i=2] exec _n$@
  77. end
  78. # check if startup command was loaded
  79. if scmp "$@{chain_str}" "<>" ""; then
  80.     # yes, execute it now
  81.     [i=2] exec _n$@{chain_str}
  82. endif
  83. # done
  84. exit
  85.  
  86. #
  87. #    fatal - execution errors trapped here
  88. #
  89.  
  90. : fatal
  91.  
  92. echo
  93. echo "PROFILE: Fatal execution error \\"
  94. # check if we processed PROFILE.SET yet
  95. test $@{linctr} 0 || echo "line $@{linctr} PROFILE.SET \\"
  96. echo "- aborting."
  97. exit 1
  98.