Stack
Übersicht

![]() |
5k41Betreff: Stack |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hallo
Hier ein kleiner Stack, den ich grade geschrieben habe um Banks mal zu benutzen... wenns zu schlecht ist dann bitte einfach Trashen! Code: [AUSKLAPPEN] hndl = StackInit() Print "Push "+10 StackPush(hndl,10) Print "Push "+250 StackPush(hndl,250) Print "Push "+27 StackPush(hndl,27) Print "Pop "+StackPop(hndl) Print "Pop "+StackPop(hndl) Print "Pop "+StackPop(hndl) StackRelease(hndl) Function StackInit() Return CreateBank(0) End Function Function StackPush(hndl,value) Local size = BankSize(hndl) ResizeBank(hndl,size + 4) PokeInt(hndl,size,value) End Function Function StackPop(hndl) Local size = BankSize(hndl) - 4 Local value = PeekInt(hndl,size) ResizeBank(hndl,size) Return value End Function Function StackRelease(hndl) FreeBank(hndl) End Function MfG |
||
Projekte:
For a better World - Gesellschaftsspiel ( 100%) User posted image |
![]() |
PowerProgrammer |
![]() Antworten mit Zitat ![]() |
---|---|---|
OMG, ich weiß nicht, obs würdig ist, fürs Codearchiv...
Aber praktisch ist es, vorallem wenn man mehrere Werte von einer Funktion zurückgeben möchte. Das liebe ich in Assembler^^ |
||
www.xairro.com Alles für Webmaster und Programmierer! Es gibt mehr als bloß einen Counter! |
Coffee |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
ah ja assembler...tolle sprache... | ||
*Mjam* |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group