home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
MAGAZINE
/
PROGJOUR
/
PJ_7_5.ZIP
/
TEST2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-07-03
|
766b
|
35 lines
/*
TEST2.C - Same as TEST.C, except using objects
*/
#include "stdio.h"
#include "pubclass.h"
main()
{
int x;
Obj item;
Obj header=New(TwllHead);
/* add 3 entries of each type to the list*/
for (x=3;x;x--) {
item=New(DataTwll); /* create a new DataTwll Object */
Send(header,AddItem,item);
Send(item,SetX,x);
item=New(MyDataTwll); /* create a MyDataTwll */
Send(header,AddItem,item);
Send(item,SetA,"Sample.");
item=New(OtherDataTwll); /* create an OtherDataTwll */
Send(header,AddItem,item);
Send(item,SetA,x+100);
}
/* print the contents of the list */
Send(header,SendAll,Print);
exit(0);
}