Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Display The Windows Volume Control Slider
QuickTime Installer
Urdu text editor
CloneIt
Check For Qt Version
Prime Number Xtra
Lingo MarkUp Service
Macromedia Director 7: Creating Powerful Multimedia
Library for work with formatted text documents
Datagrip Net
MediaMacros Xtras Mall
 

 

 

Behavior Implementing stacks in Lingo

Added on 7/2/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: Penworks (website)

Reproduced with permission from Penworks Lingo User"s Journal

-- Source Code from the Lingo User"s Journal
-- Copyright (c) 1995 by Penworks Corporation

on initStacks
  global stackList
  set stackList =[:]
end initStacks


on push whichStack, whatItem
  global stackList

  set whichList =getaProp(stackList, whichStack)
  if (voidP(whichList)) then
    set whichList =[]
    addProp(stackList, whichStack, whichList)
  end if
  append(whichList, whatItem)
end push


on pop whichStack
  global stackList

  set whichList =getaProp(stackList, whichStack)
  if (voidP(whichList)) then
    alert "Attempt to pop from non-existent stack: #"&whichStack
    return 0
  end if
  set stackSize =count(whichList)
  if not stackSize then
    alert "Attempt to pop from empty stack: #"&whichStack
    return 0
  end if

  -- Now get the item, then delete it
  set thisItem =getLast(whichList)
  deleteAt(whichList, stackSize)

  return(thisItem)
end pop


on closeStacks
  global stackList
  set stackList =[:]
end closeStacks

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail