Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting String to Byte
Message
De
28/11/2011 22:12:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Converting String to Byte
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01529948
Message ID:
01529948
Vues:
77
I have the following code (this works) which gets a byte (SAFEARRAY) from an ActiveX component and saves to a file:
LOCAL ARRAY laHotKeys[1] AS Byte
laHotKeys = 0
COMARRAY(this.Globals,10)
this.Globals.GetHotKeys(@laHotKeys)
lcFileName = GKKGetConfigPath() + "UserKeyBindings.txt"
STRTOFILE(laHotKeys[1],lcFileName)
I am then trying to read back in the file with the following code:
LOCAL ARRAY laHotKeys[1] AS Byte
COMARRAY(thisform.CodeMax.Globals,10)
laHotKeys[1] = CREATEBINARY(FILETOSTR("GKKKeyBindings.txt"))
this.Globals.SetHotKeys(@laHotKeys)               && Failing here with invalid datatype
I can set a breakpoint and see the value at laHotKeys[1] is in the correct format. However, when the SetHotKeys method is called the value in the array is changed and the error is trapped.

What is the correct way to convert a string that was previously a byte array saved to file and then re-read in? Thank you.
Répondre
Fil
Voir

Click here to load this message in the networking platform