home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
ORefSet.4gl
< prev
next >
Wrap
Text File
|
1996-07-02
|
2KB
|
61 lines
-----------------------------------------------------------------------------
--
-- Copyright (c) 1994 by Westmount Technology B.V., Delft, The Netherlands.
--
-- This software is furnished under a license and may be used only in
-- accordance with the terms of such license and with the inclusion of
-- the above copyright notice. This software or any other copies thereof
-- may not be provided or otherwise made available to any other person.
-- No title to and ownership of the software is hereby transferred.
--
-- The information in this software is subject to change without notice
-- and should not be construed as a commitment by Westmount Technology B.V.
--
-----------------------------------------------------------------------------
--
-- File : @(#)ORefSet.4gl 1.1
-- Author :
-- Original date : 19-10-1994
-- Description : An ordered set of object references
--
-----------------------------------------------------------------------------
INCLUDE "ORefSet.4gh"
FUNCTION ORefSet::ORefSet(increment INTEGER)
: ixVector(increment)
LET curr = 0
END FUNCTION
FUNCTION ORefSet::append(ref ixObject) RETURNING INTEGER
-- Error without parentheses:
-- "This RETURN statement must provide a return value"
RETURN (insert(ref))
END FUNCTION
FUNCTION ORefSet::remove(ref ixObject) RETURNING VOID
VARIABLE i INTEGER
VARIABLE obj ixObject
FOR i = 1 TO getCount()
IF ref == get(i) THEN
LET obj = delete(i)
RETURN
END IF
END FOR
END FUNCTION
FUNCTION ORefSet::size() RETURNING INTEGER
RETURN getCount()
END FUNCTION
FUNCTION ORefSet::first() RETURNING ixObject
LET curr = 1
RETURN get(curr)
END FUNCTION
FUNCTION ORefSet::next() RETURNING ixObject
LET curr = curr + 1
RETURN get(curr)
END FUNCTION