>>>Replace R8 with substr(varb,8,1) - which doesn't work. >>>>>>
>>>Replace varb with CharToVarbinary(R1 + R2 ... + R10) >>>>>>
>>Replace R8 with substr(varb,8,1)#0h0 >> >>Replace varb with IIF(R1,0h1,0h0)+... >> >>>>
>>Replace R8 with BITTEST(varb,8) >> >>... >>>
>? rf_rptlvl 0h0000000111 varbinary is a byte base datatype then 0h0000000111 = 0b0000000000000000000000000000000100010001 >? VARTYPE(rf_rptlvl) Q >? BITTEST(rf_rptlvl,1) .F. * BITTEST check the bit within the varbynary string * - start with left first byte * - for each byte lower bit is map to 0 index * then FOR k=0 TO 15 ? m.k,BITTEST(0h1480,m.k) next * print * 4 0 .F. 1 .F. 2 .T. 3 .F. * 1 4 .T. 5 .F. 6 .F. 7 .F. * 0 8 .F. 9 .F. 10 .F. 11 .F. * 8 12 .F. 13 .F. 14 .F. 15 .T. >>
>? rf_rptlvl 0h0000000011
>? ConvertToRegularNumeric(rf_rpflvl) = 3 .T.
>
>