Set() function
Posted: Wed Jul 29, 2020 10:25 pm
Hi DevTeam & Antonio
According the VFP help:
- All Set() string identifiers are reserved words, so they can be abbreviated to 4 chars.
- It´s not possible to change a setting with the Set() function. This must be done with the SET commands.
- some settings require a additional - position - param
? Set ("Device") -> <STRING> SCREEN, PRINTER, or FILE
? Set ("Device" , 1 ) -> <STRING> cFileName
or
? Set ("Device" , "1" ) -> <STRING> cFileName
- logical return values are displayed as "ON"/"OFF"
My first idea to scan the array returned by enum.GetNames( TypeOf (XSharp.Set)) to detect the full name of a abbreviated word is not a good idea, because XSharp.Set contains the identifiers of all dialects. Let´s say, XSharp.Set contains these identifiers
and i want to know the "Compatible" setting.
When comparing with "Comp" or "Compa" always "Compare" and never "Compatible" is found. So
would return the value of the wrong setting. Any ideas how to find the full name of a abbreviated word ? Sure, i could create my own scan list, but i prefer a cleaner solution ?
regards
Karl-Heinz
According the VFP help:
- All Set() string identifiers are reserved words, so they can be abbreviated to 4 chars.
- It´s not possible to change a setting with the Set() function. This must be done with the SET commands.
- some settings require a additional - position - param
? Set ("Device") -> <STRING> SCREEN, PRINTER, or FILE
? Set ("Device" , 1 ) -> <STRING> cFileName
or
? Set ("Device" , "1" ) -> <STRING> cFileName
- logical return values are displayed as "ON"/"OFF"
My first idea to scan the array returned by enum.GetNames( TypeOf (XSharp.Set)) to detect the full name of a abbreviated word is not a good idea, because XSharp.Set contains the identifiers of all dialects. Let´s say, XSharp.Set contains these identifiers
Code: Select all
...
...
MEMBER Compare := 888
...
...
MEMBER Compatible := 666
...
...
Code: Select all
? Set ( "comp" )
Code: Select all
LOCAL nSetting AS XSharp.Set
IF Enum.TryParse( cFullIdentifierName , TRUE, OUT nSetting )
uRet := XSharp.RT.Functions.Set(nSetting)
ENDIF
would return the value of the wrong setting. Any ideas how to find the full name of a abbreviated word ? Sure, i could create my own scan list, but i prefer a cleaner solution ?
regards
Karl-Heinz