Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you tell if a property is an array (version 8)
Message
From
13/04/2009 09:49:45
 
 
To
13/04/2009 09:31:52
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01393713
Message ID:
01394568
Views:
50
Mike --

Once again we disagree.

My comment on complexity merely referred to how complex (or obscure, if you wish) a statement must be before you decide to put that code in a separate PRG (or method, depending). At some point, each of us must decide where that point is.

My principal point was that, for me, the statement "U" # Type("Alen(myArray(1)) ") was not sufficiently complex, and your other statement was. (I also pointed out the alternative you gave to the statement I thought acceptable was not identical anyway. -- which identifies a separate concern, that is, the problems that can occur during attempts at modularizing your code after the fact -- you may unknowingly change functionality)

As it happens, I'm a strong believer in writing module code and systems. Have fought numerous battles, when I supervised others, to try to get them to do the same.





>>I guess I disagree -- a simple comment takes care of it for me.
>>
>>I guess it also depends on the relative complexity, as well, and the definition of "complexity" is up to you. To me, at least, the replacement code is not much easier to read than the original -- which is not true at all of the other example you gave.
>
>It does not depend on complexity. A computer system tends towards complexity unless you use modular designs. Just imagine the rats nest an engine would be without encapsulated spark plugs - and by that I mean the deconstructed components. Individual wires stuck in the cylinder, etc. Only software people can claim they prefer the mess.
>
>>
>>>>Mike --
>>>>
>>>>Thanks for the link. I admire the attempt at clarity -- even I won't be using this to replace the only reference I have to it.
>>>>
>>>>Jim
>>>
>>>All the more reason to have it, IMO. What do you think this means: GOMONTH(DATE() - DAY(DATE()) + 1, 1) - 1
>>>
>>>A rose by any other name would smell as sweet, but having to decipher a formula stinks.
>>>
>>>>
>>>>>>I have a question about determining whether a variable is an array: From the Help file: (version 8, not 9!)
>>>>>>
>>>>>>You can also use the TYPE( ) function to check if a memory variable is an array. For example:
>>>>>>? TYPE("myarray[1]")#"U"

>>>>>>
>>>>>>This apparently works as well for properties. Except for one special counter-example - native properties:
>>>>>>
>>>>>>Guesses on the results from the following?
>>>>>>
?Type("loForm.visible(1)")
>>>>>>?Type("loForm.visible(0)")
>>>>>>
>>>>>>Is there some other consistent method for determining whether a property is an array?
>>>>>
>>>>>http://fox.wikis.com/wc.dll?Wiki~X2ISARRAY~VFP
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform