home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / readme / fileins / stdprefw.fx1 < prev    next >
Encoding:
Text File  |  1995-10-24  |  968 b   |  31 lines

  1. EstdTools becomeDefault!
  2.  
  3. !EstdTools class publicMethods !
  4.  
  5. preferencesText
  6.  
  7.     "Return the contents of the preferences workspace."
  8.     | fileName file ans |
  9.     fileName := 'abtpref.txt'.
  10.  
  11.     file := CfsReadFileStream open: fileName.
  12.     file isCfsError ifFalse: [
  13.         | line workStream |
  14.         workStream := WriteStream on: (Locale current preferredStringClass new: 1028).
  15.         [file atEnd] whileFalse: [
  16.             line := file nextLine.
  17.             "Strip any trailing CTRL-Z."
  18.             (file atEnd and: [line notEmpty and: [line last value = 26]])
  19.                 ifTrue: [line := line copyFrom: 1 to: line size - 1].
  20.             workStream nextPutAll: line; cr].
  21.         file close.
  22.         ans := workStream contents].
  23.  
  24.     ^EmImageSupport sourceFilter filterAndBreakLines: (ans size = 0 
  25.         ifTrue:[NlsCatESTD indexedMsg: 7]     "$NLS$ the contents of the preferences workspace"
  26.         ifFalse:[ ans ]).! !
  27.  
  28. EstdTools class categoriesFor: #preferencesText are:((OrderedCollection new)
  29.     add: 'ESTD-Internal';
  30.     yourself)!
  31.