Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if controlsource is a field or a variable/prop
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00592686
Message ID:
00593529
Views:
31
>>>The new DO CASE based on your reply
>>>Thanks all :-)
>>>
>>>
>>>DO CASE
>>>   CASE nDots > 1  && object property
>>>     lIsField=.F.
>>>   CASE nDots = 1  && property or field
>>>     lIsField= USED(JUSTSTEM(.controlsource)) AND FSIZE(JUSTEXT(.controlsource))>0 && returns .t. if field
>>>   OTHERWISE  && nDots=0
>>>     lIsField= FSIZE(.controlsource)> 0
>>>ENDCASE	
>>>
>>>
>>
>>Gerald,
>>Parsing was prohibited :)?
>>Some comments which might never apply :
>>-Multiple dots where conrolsource is multiple fields.
>>-Dots=0 and isField and alias not the current one
>>-Dots=1 this sounds better :
>>lIsField= FSIZE(JUSTEXT(.controlsource), JUSTSTEM(.controlsource))>0
>>-Dots = 1 but memvar, same name field in current alias && 'm.First_Name'
>>-Dots = 0 but old syntax && 'myTable->First_Name'
>>
>>Cetin
>
>That was a lot of testing for a simple checkbox...
>I want a good reaction time and if i do all that testing i will lose a lot of CPU cycles...
>
>I think i will forget about all that stuff and use a normal checkbox
>out of sight in the container and let it hold the controlsource.
>
>:-)

Another alternative would be to have a property on the form, like:

lControlSourced

Set that to .T. as your default, set to .F. where not the case.

Then you have a simple way of determining the path your code can take to effectively process.

Jay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform