Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why a string comes back as null
Message
From
03/12/2008 13:02:11
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
03/12/2008 12:50:55
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Miscellaneous
Thread ID:
01365266
Message ID:
01365393
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform