Binary, Hex, Oct
Is there an easy way to convert Dec to Binary. If not anyone got an idea on how to do it?
Do you mean in DataEase directly?
Yes in Dataease
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