Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>Me too :) But I think my question was a valid one.
>
>In other words, if your numbers use scientific notation, do you want to preserve it for saving and restoring as well?
This is the whole story:
I already had a class for saving and restoring data to the registry. Now I'am doing this Form to set up parameters for a ZEBRA label printer, like left margin, top margin, darkness, print speed, printer name, etc.
So I just dropped my registry class in the form and started coding. After a while, I realized that my registry class is "registry oriented" that is, you had to specify how to store a value in the registry in "registry terms" like REG_SZ, REG_BINARY and so on.
I decided to change the registry class and do it more VFP oriented, that is, store NUMERIC, DATE, DATETIME, CHARACTER, LOGICAL and VARBINARY values, without worrying about the registry format, so that is what I did, now I just do:
oRegistry.SetValue(cValueName, eValue)
oRegistry.GetValue(cValueName, eDefaultValue)
And that's it, the class takes care of everything, no more worrying about REG_SZ, REG_DWORD, etc. Also the registry key defaults to HKCU\Software\Exename, no need to worry about that either.
Since the numeric values I plan to use are things like LEFT MARGIN, TOP MARGIN, PRINT SPEED, NUMBER OF COPIES, etc, I think .999999999999999 to 999999999999999 pretty much covers my range.
I don´t think I will need to store bigger numbers in the registry, now or in the future, so I don´t need scientific notation capability for now.
Since I will be releasing this shortly as part of the ctl32 classes, if anyone has other requirements, the source code will be available for anyone to change.
Carlos
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement