Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to query the registry with WScript.Shell
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00571288
Message ID:
00571696
Vues:
25
>>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.


Thanks George, now after that you have explained about the Err object i understand why I could not query the registry first for the existance of the key and I have to take back the words "architect had overlooked..... ".

/Torgny
/Torgny
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform