Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if controlsource is a field or a variable/prop
Message
From
11/12/2001 23:29:06
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00592686
Message ID:
00593090
Views:
29
This message has been marked as the solution to the initial question of the thread.
Here's the function I use.
* FUNCTION IsField
LPARAMETERS String
* Pass in a string that may be a memory variable,
* a Field_Name, an Alias.Field_Name, or an object reference.
* Returns true if the string corresponds to a field.
* This function allows one to know if a Value must 
* be REPLACEd into a ControlSource, or STOREd to it.

* Depends on SET COMPATIBLE to be set to OFF or FOXPLUS (the default)!

RETURN (OCCURS('.', m.String) = 1 AND USED(JUSTSTEM(m.String)) ;
	AND FSIZE(JUSTEXT(m.String),JUSTSTEM(m.String)) > 0) ;
	OR (OCCURS('.', m.String) = 0 AND FSIZE(m.String) > 0)
>Is there a way to determine if a controlsource was a table field or a property - variable?
>
>I need to know this to assign a new value to the controlsource of an object programmatically. I have added the "controlsource" property to a container and i need a way to reassing a value to this controlsource.
>
>Fields use the REPLACE command and properties/variables use the "=" assignation.
>
>Any clue?
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform