Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to query the registry with WScript.Shell
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00571288
Message ID:
00571595
Views:
20
>Well i have just started to look into the Windows Scripting Host and i think the methods for manipulating the registry seemes easy to use. I just dont understand how the "architect" of this "Registry-methods" could have overlooked the need of testing for the existance of a key before trying to read from it or getting some special return value if the key doesnt exist.I am sure that the use of FFC's registry classes is far more flexible.
>
/Torgny,

You've got to remember that the WSH is designed to be used with JScript and VBScript. In those environments, you'd use the Err object to determine the nature of the error. In this case, the Description property would say that the key did not exist and the number property would return 0x80070002. Unfortunately, this object is not accessible from within VFP.

This is not to say that the WSH does not have its uses within the VFP environmant. As Ed Rauh and I said in our series on it that appeared last year in the VFUG (www.vfug.org) newsletter, it can help you do things easily that otherwise can't be done from within VFP or would take a lot of code dealing with the API. There's a place for both and one should evaluate what the WSH does and doesn't give you when deciding how to approach a problem with a potential WSH solution.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform