Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-09 Thread Tomasz Tyrakowski t.tyrakow...@sol-system.pl [firebird-support]
On 08.08.2018 o 11:49, 'River~~' river14ap...@gmail.com [firebird-support] wrote: > [...] > So to go back to the original point I disputed, I personally intend to go > on referring to the byte terminating a C string as being x00 not as the > more pedantically correct chr(0). > [...] To be

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-08 Thread 'River~~' river14ap...@gmail.com [firebird-support]
Hi Hamish Thanks for introducing float to this discussion: the varying ways different architectures store the 'same' float (like 3.0e8 for example) amplify the point I was making. A float is stored in binary. That is not suggesting that it is stored as the base2 coding of it as an integer.

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-07 Thread Hamish Moffatt ham...@risingsoftware.com [firebird-support]
On 04/08/18 23:06, 'River~~' river14ap...@gmail.com [firebird-support] wrote: To say an octet is in hex is no more wrong than to say some number is stored as a float. It's all just a bucket of bits. Hex or float or Integer are always presentation Float or integer is definitely not a matter

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Got it! Thanks. Chuck On 8/4/2018 5:11 AM, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] wrote: > On 4-8-2018 13:05, Chuck Belanger phytot...@lanset.com > [firebird-support] wrote: >> This worked beautifully. Thank you! >> >> There was no need to change my code, simply add a new

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you, River, I very much appreciate the tutorial. Chuck On 8/4/2018 3:59 AM, 'River~~' river14ap...@gmail.com [firebird-support] wrote: Hi again Chuck Sorry I was a bit cryptic there. There follows a quick primer in logical bitwise operations If it helps, use it. If not, code the

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 4-8-2018 15:06, 'River~~' river14ap...@gmail.com [firebird-support] wrote: > You are pedantically correct but... > > ALL storage in ALL modern computers is in binary. This may sounds pedantic, but it is not in my opinion. I have seen enough systems storing binary data by encoding it using

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread 'River~~' river14ap...@gmail.com [firebird-support]
Hi Mark. You are pedantically correct but... ALL storage in ALL modern computers is in binary. When we declare a field as integer, char, octet, etc we are specifying two things: how it is presented and what manipulation we can do on it. To say an octet is in hex is no more wrong than to say

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 4-8-2018 13:05, Chuck Belanger phytot...@lanset.com [firebird-support] wrote: > This worked beautifully. Thank you! > > There was no need to change my code, simply add a new OCTETS based > Domain and change domains on the field. All the Char(0)s are stored as > 0's in what looks like a HEX

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
This worked beautifully. Thank you! There was no need to change my code, simply add a new OCTETS based Domain and change domains on the field. All the Char(0)s are stored as 0's in what looks like a HEX based number. Chuck On 8/4/2018 1:54 AM, Dimitry Sibiryakov s...@ibphoenix.com

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread 'River~~' river14ap...@gmail.com [firebird-support]
Hi again Chuck Sorry I was a bit cryptic there. There follows a quick primer in logical bitwise operations If it helps, use it. If not, code the "top bit setting" any way that makes sense to you. I would always recommend you code it the way you understand rather than the way some geeky C

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you, I will try that first. Chuck On 8/4/2018 2:46 AM, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] wrote: > 04.08.2018 11:44, Chuck Belanger phytot...@lanset.com [firebird-support] > wrote: >> As far as I know NONE or OCTET is the closest thing to rawbyte, but as I >>

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
04.08.2018 11:44, Chuck Belanger phytot...@lanset.com [firebird-support] wrote: > As far as I know NONE or OCTET is the closest thing to rawbyte, but as I > mentioned (and > another responded) the string is being truncated at the first #0. Yes, that's the case for charset NONE. OCTETS must

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you guys for your thoughtful response! I really like the idea of just using 7 bits and keeping the 8th a '1', thus ruling out the possibility of ever having a #0. It is an easy conversion in my routine and storage. As far as I know NONE or OCTET is the closest thing to rawbyte, but as

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
04.08.2018 0:49, Chuck Belanger phytot...@lanset.com [firebird-support] wrote: > The above string is created and > stored in a string just as you see it, but how do I store it in Firebird > , preferably as-is in a table field? Use field (VAR)CHAR CHARACTER SET OCTETS. Then "just store" your

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread 'River~~' river14ap...@gmail.com [firebird-support]
Hi Chuck I am a Firebird newbie so don't know if Fbd will let you do what you want. Perhaps there is a fixed length raw byte field you could use, or perhaps a blob? If it does not, then a more efficient work around than the one yours would be to store only seven bits to a byte, forcing the top

[firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-03 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello: I have been using a string of ''s and '1's to indicate access to the underlying position in a database. I have been storing this string of '000111' combinations by converting to a set of characters representing each 8 "bits" of the actual 0s and 1s. The problem I am facing is