Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty this...
Message
 
 
To
20/03/2008 18:25:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01304137
Message ID:
01304193
Views:
14
>>What's the best way to EMPTY an array element, regardless of datatype, without messin' with the structure?
>
>I'll assume by EMPTY you mean, make it so EMPTY( foo[ i ] ) = .T.
>
>Not sure what you mean by "the structure":
>
>- if you mean just the array's dimensions, you could just set the element to .F.
>- if you want to replace the element with a blank version of the same datatype, I don't know the answer to that. You could write a little function to do it, or maybe there's an elegant way to do it I'm not aware of.
>
>UPDATE: if you're using VFP9 you could experiment with CAST():
>
>foo[ i ] = CAST( "" AS ( TYPE( "foo[ i ]" ) ) )
>
Hmmm, that's actually much better. Why I didn't think of that?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform