Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collections are cool
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Collections are cool
Divers
Thread ID:
00719394
Message ID:
00719394
Vues:
51
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform