>I've been looking for a VFP function or a UDF that will allow me to determine if an object's control source refers to either a column in a cursor/table or to a memory variable. If it refers to a column I need to do a REPLACE command to update the column. If it refers to a memory variable I need to replace the value in the variable. Something like this is what I'm looking for:
>
> IF OBJTYPE(Object.ControlSource) = 'C'
> REPLACE (Object.ControlSource) WITH ltNewDateTime
> ELSE
> STORE ltNewDateTime TO (Object.ControlSource)
> ENDIF
>
>Thanks!!!
>Jim
LOCAL lcControl
lcControl = IIF(UPPER(LEFT(Object.ControlSource,2)) == [M.],SUSBTR(Object.ControlSource,3),Object.ControlSource)
DO CASE
CASE TYPE([m.]+lcControl) == [U] AND;
TYPE(lcControl) # [U]
REPLACE (lcControl) WITH WITH ltNewDateTime
CASE TYPE(lcControl) == [C]
STORE ltNewDateTime TO (lcControl)
OTHERWISE
ENDCASE
(not tested for all occasions)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.