home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR19
/
OBJPROB.ZIP
/
STACK.PRG
< prev
next >
Wrap
Text File
|
1993-09-24
|
1KB
|
42 lines
/*
╔═══════════════════════════════════════════════════════════════╗
║ Módulo: Stack.prg ║
║ Lenguaje: Clipper 5.0x + ObjectsP ║
║ Fecha: Marzo 1993 ║
║ Compilar: Clipper Stack /a /n /w ║
║ Desc.:Demo de clases: Stack Class ║
║ ║
║ (c) 1993 Francisco Pulpón y Antonio Linares ║
╚═══════════════════════════════════════════════════════════════╝
*/
#include "ObjectsP.ch"
CLASS Stack
HIDE DATA aStack AS Array
METHOD New() INLINE ::aStack := {}, Self
METHOD Push( uVal ) INLINE aadd( ::aStack, uVal ), uVal
METHOD Top() INLINE atail( ::aStack )
METHOD lEmpty() INLINE Empty( ::aStack )
METHOD Pull
ENDCLASS
METHOD Stack.Pull()
local uRet, aStack := ::aStack
if !Empty( aStack )
uRet = aTail( aStack )
aSize( aStack, len( aStack ) - 1 )
endif
Return uRet