Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread BYTE datatype
Sat, Apr 2 2011 6:07 AMPermanent Link

Jeff Newlin

Lightspeed

I'm using the BYTE datatype for the first time and I know I'm missing something simple.

I have a table with a field "Test" this is of type BYTE

I understand that since I'm not specifying a length it should be 1 byte.

I tried storing a byte into it and that seems to work using :

INSERT INTO TestTable (Test) VALUES (X'00')


Now I'm trying to read this back out to a byte variable called My_byte

I've been using FieldByName on things like this but I can't seem to find the way to convert it into a simple byte.

Can you tell I'm new ?

Thanks for any help!
Jeff
Sat, Apr 2 2011 9:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jeff


Forget the name and think of it as being the same as a CHAR or VARCHAR the essential difference being that you can have the "funny" characters as well as the alphamerics. So depending on the contents you should be able to use .AsString or .AsWideString or .AsVariant to dump them into a string variable which can then be put into an array of byte (pretty much what a string is). If you're using one of the newer Delphis use an AnsiString.

The above is a guess since I've never used the BYTE datatype Smiley

Roy Lambert [Team Elevate]
Sat, Apr 2 2011 7:54 PMPermanent Link

Jeff Newlin

Lightspeed


Thanks Roy that's got me going again!



Roy Lambert wrote:

Jeff


Forget the name and think of it as being the same as a CHAR or VARCHAR the essential difference being that you can have the "funny" characters as well as the alphamerics. So depending on the contents you should be able to use .AsString or .AsWideString or .AsVariant to dump them into a string variable which can then be put into an array of byte (pretty much what a string is). If you're using one of the newer Delphis use an AnsiString.

The above is a guess since I've never used the BYTE datatype Smiley

Roy Lambert [Team Elevate]
Image