Hi Fabio,
I would also expect that SET("KEY") function would return SET KEY expression in the format that can be eaily reused in another SET KEY command. In addition, in the case of DATE expression returned values are ambiguous because they depends on SET DATE and other settings.
You can post ER to VFP WIsh list but for now you will've to deal with it.
>Hi,
>
>i try to write a generic clone function for a workarea.
>
>For ORDER it is ok
>For FILTER it need a slow macro, but i can
>For SET KEY problem occurs.
>
>If expression index is logical,date,datetime and character,
>SET("KEY") return a incomplete string.
>This can to be ambiguous.
>
>Example:
>
>CREATE CURSOR MyTest ( fDate D DEFAULT DATE() UNIQUE)
>APPEND BLANK
>SET ORDER TO 1
>SET KEY TO DATE()
>? SET("KEY")
>
>CREATE CURSOR MyTest ( fDate C(10) default DTOC(DATE()) UNIQUE)
>APPEND BLANK
>SET ORDER TO 1
>SET KEY TO DTOC(DATE())
>? SET("KEY")
>
>
>
>My aspect result is direct useful for EVALUATE().
>
>EXAMPLE:
>
>m.Key1=EVAL(SET("KEY",1))
>
>
>Why SET("KEY") command is incomplete ?
>
>
--sb--