Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VarBinary
Message
De
18/08/2010 13:07:05
 
 
À
18/08/2010 05:04:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01476933
Message ID:
01477095
Vues:
39
>>Hi All:
>>
>>I have a VARBINARY field in my table called varb with a value of, say, 0h0000011111. I want to set up ten fields in my table (R1 to R10) that represents each bit, so that the user can easily change each bit.
>>
>>What syntax would I use to transfer each bit to the proper field such as:
>>
>>
>>Replace R8 with substr(varb,8,1) - which doesn't work.
>>
>>
>>THEN, once the user has completed his task, I would need the equivalent of
>>
>>
>>Replace varb with CharToVarbinary(R1 + R2 ... + R10)
>>
>>
>>Thanks,
>>
>>Yossi
>
>
>
>Replace R8 with substr(varb,8,1)#0h0
>
>Replace varb with IIF(R1,0h1,0h0)+...
>
>
>
>you can shrink data using varb=0h0F and
>
>Replace R8 with BITTEST(varb,8)
>
>...
>
Fabio:

1. What do you mean by 'you can shrink data using varb=0h0F'
2. I say:
? rf_rptlvl                         0h0000000111
? VARTYPE(rf_rptlvl)       Q
? BITTEST(rf_rptlvl,1)      .F.
Shouldn't I be getting .T. on the BITTEST(rf_rptlvl,1)? What am I doing wrong?

3. How can I accomplish:
? rf_rptlvl                         0h0000000011
? ConvertToRegularNumeric(rf_rpflvl) = 3    .T.
Thanks,

Yossi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform