Hex/Octal/Binary Formatting

Discuss the database features

Hex/Octal/Binary Formatting

Postby scienceyankee » Mon Feb 20, 2017 2:35 am

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?
Apache OpenOffice 4.1.3
AOO413m1(Build 9783) Rev 1761381

Windows 10 Home
scienceyankee
 
Posts: 8
Joined: Sun Jan 15, 2017 3:11 pm

Re: Hex/Octal/Binary Formatting

Postby UnklDonald418 » Mon Feb 20, 2017 7:35 pm

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.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1122
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Hex/Octal/Binary Formatting

Postby scienceyankee » Mon Feb 20, 2017 8:43 pm

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)
Apache OpenOffice 4.1.3
AOO413m1(Build 9783) Rev 1761381

Windows 10 Home
scienceyankee
 
Posts: 8
Joined: Sun Jan 15, 2017 3:11 pm


Return to Base

Who is online

Users browsing this forum: No registered users and 4 guests