home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
RB3641.ZIP
/
EX2
/
READLIST.MTH
< prev
next >
Wrap
Text File
|
1991-12-16
|
1KB
|
39 lines
!ToDoList methods !
readList
"Read the ToDo list from disk.
The list is stored as a binary data using the
ObjectFiler. so a new collection
can be built by loading the contents of the file
by using the ObjectFiler.
This method is used in two places:
- when ToDo application window is opened.
- when Open is selected in File-pulldown. "
| input tmpList testItem |
input := Disk file: 'TODOFILE.OBJ'.
input close.
input := Disk file: 'TODOFILE.OBJ'.
((input contents) = '') ifTrue: [
tmpList := OrderedCollection new.
testItem := ToDoItem new.
testItem type: 'Personal'.
testItem deadline: '99.12.31'.
testItem description: 'Celebrate!!'.
"testItem priority: 'High'."
testItem priority: 1.
testItem completed: false.
5 timesRepeat: [ tmpList add: testItem ].
]
ifFalse: [
tmpList := ObjectFiler loadFromPathName: 'TODOFILE.OBJ'.
].
input close.
^(self replaceFrom:1 to:(self size) with: tmpList)! !