Page 1 of 1

Hex/Octal/Binary Formatting

Posted: Mon Feb 20, 2017 2:35 am
by scienceyankee
I am putting together a database using Base, and would like to have the key fields formatted in hex. I cannot find any formatting code to permit this; does this exist as an undocumented feature or is should I put in a feature request?

Re: Hex/Octal/Binary Formatting

Posted: Mon Feb 20, 2017 7:35 pm
by UnklDonald418
Base key fields are usually of data type Integer or Long. Like Decimal, Octal and Hexadecimal are simply alternate ways of displaying a numeric value as a string.
According to Andrew Pitonyak in his book “OpenOffice.org Macros Explained”
OOo users almost always use decimal numbers
If you are willing to venture into macro coding, Star Basic does have functions Hex(number) and Oct(number) which convert the number to the appropriate string.
I'm not aware of any equivalent SQL functions.

Re: Hex/Octal/Binary Formatting

Posted: Mon Feb 20, 2017 8:43 pm
by scienceyankee
My general preference is numbers used as keys be in hex or octal form; this is primarily to remind people that arithmetic with them is not useful ;)

I've not done SQL for a while, and that was through an API, so the calling program would do all the formatting (it's all bits ;)). I think there is an SQL formatting code to display numbers in hex (see http://docs.oracle.com/cd/B19306_01/ser ... #sthref402)