Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : RETURNDL.CLS

 
Output of file : RETURNDL.CLS contained in archive : ACTTIMS.ZIP
/* class comment */!!

inherit(TimsDialog, #ReturnDlg, #(info), 2, nil)!!

now(class(ReturnDlg))!!

now(ReturnDlg)!!

Def returnBook(self | LBStr, borrower, stat, friendStr)
{
LBStr := new(String, 32);
LBStr := getLBText(self, IDI_LIST);
borrower := new(BorrowObj, database);
if findKey(info, ID_CODE, LBStr) = S_OKAY then
friendStr := removeNulls(getItemText(self, IDI_BORROWER));
setOwner(borrower, info);
stat := first(borrower);
loop
while stat = S_OKAY
if removeNulls(getFriend(borrower)) = friendStr then
if getDateReturned(borrower) = 0L then
setDateReturned(borrower, asLong(asInt(getItemText(self, IDI_RETURNED),10)));
write(borrower);
^end(self, 0);
endif;
endif;
stat := next(borrower);
endLoop;
errorBox("Borrower not on file.", "TIMS");
else
errorBox("Selected item is not on file.", "TIMS");
endif;
^end(self, 0);
}
!!

Def modifyBorrower(self)
{
if limit(getItemText(self, IDI_BORROWER)) > 0 and
limit(getItemText(self, IDI_RETURNED)) > 0 and
limit(getLBText(self, IDI_LIST)) > 0 then
enableItem(self, IDI_OK);
else
disableItem(self, IDI_OK);
endif;
}
!!

Def view(self | LBStr, author)
{
LBStr := new(String, 16);
LBStr := getLBText(self, IDI_LIST);
if size(LBStr) > 0 then
author := new(AuthorObj, database);
if findKey(info, ID_CODE, LBStr) = S_OKAY then
getOwner(info, author);
setItemText(self, IDI_AUTHOR, getName(author));
setItemText(self, IDI_TITLE, getInfoTitle(info));
if limit(getItemText(self, IDI_BORROWER)) > 0 and
limit(getItemText(self, IDI_RETURNED)) > 0 then
enableItem(self, IDI_OK);
else
disableItem(self, IDI_OK);
endif;
else
errorBox("Selected item is not on file.", "TIMS");
endif;
else
setItemText(self, IDI_AUTHOR, "");
setItemText(self, IDI_TITLE, "");
disableItem(self, IDI_OK);
endif;
}
!!

/* By returning a 1 from the INITDIALOG message, we
are telling MS-Windows to set the input focus to
first tabstop item. (See MS-Windows Reference). */
Def initDialog(self, wP, lP | stat)
{
database := getDB(parent);
info := new(InfoObj, database);
stat := firstKey(info, ID_CODE);
loop
while stat = S_OKAY begin
addLBText(self, IDI_LIST, getIdCode(info));
stat := nextKey(info, ID_CODE);
endLoop;
disableItem(self, IDI_OK);
^1;
}!!

Def command(self, wp, lp)
{ select
case wp == IDI_CANCEL
is ^end(self, 0);
endCase
case wp == IDI_OK
is returnBook(self);
endCase
case wp == IDI_LIST
is view(self);
endCase
case wp == IDI_RETURNED and high(lp) = EN_CHANGE
is modifyBorrower(self);
endCase
case wp == IDI_BORROWER and high(lp) = EN_CHANGE
is modifyBorrower(self);
endCase
endSelect;
^0;
}!!

  3 Responses to “Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : RETURNDL.CLS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/