home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
viscobv6.zip
/
vac22os2
/
ibmcobol
/
samples
/
editor
/
lxmin2.c
< prev
next >
Wrap
Text File
|
1996-12-17
|
3KB
|
92 lines
/* *
*-----------------------------------------------------------------------*
* DISCLAIMER OF WARRANTIES: *
* *
* The following enclosed code is sample code created by IBM *
* Corporation. This sample code is not part of any standard IBM *
* product and is provided to you solely for the purpose of assisting *
* you in the development of your applications. The code is provided *
* "AS IS", without warranty of any kind. IBM shall not be liable *
* for any damages arising out of your use of the sample code, even *
* if they have been advised of the possibility of such damages. *
* *
*-----------------------------------------------------------------------*
* */
/****************************************/
/* LXMIN2.C - A minimal LPEX external */
/* command in C or C++. */
/****************************************/
#include "lpexapi.h" /* include function definitions */
int lxmain(uchr *parm) /* lxmain() is the command entry point */
{
return 0; /* do nothing */
//------------------------------------------------------------------------------
// COLLECTION CLASSES: declarations and usage sample
//
// The following is generated by the VisualAge C++ Collection Classes SmartGuide
//------------------------------------------------------------------------------
#include <ies.h>
#include <iostream.h>
#include <istring.hpp>
//-----------------------------------------------------------------------------
// Collection Class declaration
//-----------------------------------------------------------------------------
typedef IEqualitySequence<IString> myCltn;
//-----------------------------------------------------------------------------
// Usage sample.
//-----------------------------------------------------------------------------
IBoolean printItem(IString const& t, void*)
{
cout << t << endl;
return true;
}
main()
{
myCltn imyCltn;
myCltn::Cursor myCursor(imyCltn);
// Use the customized constructor. Revise this if necessary.
IString element1("C.Lau");
IString element2("T.Glover");
IString element3("C.Piekny");
IString element4("D.Birsan");
imyCltn.add(element1);
imyCltn.add(element1);
imyCltn.add(element2);
imyCltn.add(element3);
imyCltn.add(element4);
// List all the items
imyCltn.allElementsDo(printItem);
// List the total number of items
cout << imyCltn.numberOfElements() << " added" << endl;
// Remove a key item
myCursor.setToFirst();
imyCltn.removeAt(myCursor);
// List the total number of items
cout << "After remove, the total number of items is: ";
cout << imyCltn.numberOfElements() << "\n\n";
// List all the items
imyCltn.allElementsDo(printItem);
}
//------------------------------------------------------------------------------
// COLLECTION CLASSES: End of VisualAge C++ SmartGuide generation
//------------------------------------------------------------------------------
}