Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collections are cool
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Collections are cool
Miscellaneous
Thread ID:
00719394
Message ID:
00719394
Views:
50
I just have to share my excitement about VFP 8 with everyone ;-) It took me all of 3 minutes to create a working First-In-Last-Out stack using VFP 8. I can already tell that I'm going to hate having to go back to VFP 7 (as much as I like it) because of all the features in VFP 8. The VFP 8 team did a great job with this release.

BTW - here's the code:
DEFINE CLASS kaFILOStack AS Collection 
   nMaxDepth = 20
   
   FUNCTION Push(tuItem)
      IF This.Count = This.nMaxDepth
         This.Remove(1)
      ENDIF
      
      This.Add(tuItem)
   ENDFUNC   

   FUNCTION Pop()
      LOCAL luItem
      luItem = .NULL.
      
      IF This.Count > 0
         luItem = This.Item(This.Count)
         This.Remove(This.Count)
      ENDIF
      
      RETURN luItem
   ENDFUNC
   
ENDDEFINE
-Paul

RCS Solutions, Inc.
Blog
Twitter
Next
Reply
Map
View

Click here to load this message in the networking platform