Simplicty and flexibility!

Binary, Hex, Oct

Started by BLESSED SHUMBA

Binary, Hex, Oct

Is there an easy way to convert Dec to Binary. If not anyone got an idea on how to do it?

Written by BLESSED SHUMBA 30/03/22 at 09:09:20 Dataease [{8}]FIVE

Re:Binary, Hex, Oct

Do you mean in DataEase directly?

Written by DataEase 30/03/22 at 10:45:33 Dataease [{8}]FIVE

Re:Re:Binary, Hex, Oct

Yes in Dataease

Written by BLESSED SHUMBA 30/03/22 at 10:47:21 Dataease [{8}]FIVE

Re:Binary, Hex, Oct

No need to worry if there isnt an easier way, have created the procedure below to do it. Can replace the 16 with 2 or 8 for Binary or Oct.

----------------------------------------------

define global "GPrinciple" number .

define global "GDividend" number. -- number being divided

define global "GRemainder" number. -- Floored integer

assign global GPrinciple := concat (midc (Current date ,4,2), Lastc(Current date , 4)) .

assign global GDividend := concat (midc (Current date ,4,2), Lastc(Current date , 4)) .

message gPrinciple window .

While GDividend not = 0 do

assign GDividend := Floor (GPrinciple/16) .

message concat ("Dividend : ", gdividend) window .

assign GRemainder := GPrinciple - (GDividend * 16) .

message concat ("Remainder : ", GRemainder) window .

assign GPrinciple := GDividend .

enter a record in Remainders

Remnant := GRemainder .

end

Written by BLESSED SHUMBA 30/03/22 at 14:32:03 Dataease [{8}]FIVE
DG3_ForumList