Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Please pretty please explain how stacks work

Author
Message
Soyuz
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 23rd Jan 2003 00:45
Could someone please do a simple example code of adding and removing items from an array stack, and using the commands:

NEXT ARRAY INDEX
PREVIOUS ARRAY INDEX
ARRAY INDEX TO TOP
ARRAY INDEX TO BOTTOM
ARRAY INDEX TO STACK
ADD TO STACK
REMOVE FROM STACK

The help file is absolutely shockingly awful at explaining how to use these. Click on "showcase example" or "usage example" doesn't even show an example or usage - GRRRrrr!!!

Thanks
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 23rd Jan 2003 18:17
You could do this

dim array(10)
rem Remove from stack
neededvalue=array(1)
array(1)=0
rem Move all of stack down one
for x=1 to 9
array(x)=array(x)+1
next x
array(10)=newvalueforstack

you use stacks for making calculators, although im no expert
this example could be not what your looking for

Yum! Yum! Yum! Yum!

Login to post a reply

Server time is: 2024-11-23 22:35:53
Your offset time is: 2024-11-23 22:35:53