Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Test for number of elements in an Array
Message
De
30/05/2006 19:25:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01126047
Message ID:
01126051
Vues:
16
>Can you test for how many elements are in an array? I need to test if the array has more than 1 element after being loaded from a table.

Since the array always has at least one element - alas, arrays with zero elements are not supported in VFP - you might better proceed as follows:
local laMyArray(1)
select ... from ...;
  into array laMyArray
if _tally > 0
  * Process the data here
else
  MessageBox("No data to process. Check your selection criteria.")
endif
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform