Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why a string comes back as null
Message
De
03/12/2008 13:02:11
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
03/12/2008 12:50:55
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Divers
Thread ID:
01365266
Message ID:
01365393
Vues:
12
Hi Gregory,

>Dunno, Tim, but why not returning null instead of "" if there are no files. [ the comparaison will be a bit faster ]
>
>Also possible
>
>
>aFunction()
>{
>    string fileName;
>    while( PopQueue(out fileName) )
>    {
>    }
>}
>
>
>bool PopQueue(out string fileName)
>{
>// if any file, put it in fileName and return true
>// otherwise return false
>}
>
Both great ideas. No reason other than my not being used to using out parameters. I wasn't aware a null comparison was faster so I learned something too. Thanks
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform