473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

'And'ing a Byte Value - How?

Folks, I get a TYPE MISMATCH complaint fm ASP when I do the following in
trying to extract the high-order four bits. The complaint being that the
strTemp value is a string. Well, yes - it's a 1-char string.

NumTemp = MidB(strTemp,1, 1) And &Hf0

What am I doing wrong? (Something dumb, I'm sure, but ... .)

AS
Jul 19 '05 #1
6 2329
Are you trying to concatenate? Use & instead of And.

Ray at work

"Arnold Shore" <as****@saefern.org> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...
Folks, I get a TYPE MISMATCH complaint fm ASP when I do the following in
trying to extract the high-order four bits. The complaint being that the
strTemp value is a string. Well, yes - it's a 1-char string.

NumTemp = MidB(strTemp,1, 1) And &Hf0

What am I doing wrong? (Something dumb, I'm sure, but ... .)

AS

Jul 19 '05 #2
No. As I said, I'm trying to extract the HO bits. Thanks,
AS

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uY**************@TK2MSFTNGP11.phx.gbl...
Are you trying to concatenate? Use & instead of And.

Ray at work

"Arnold Shore" <as****@saefern.org> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...
Folks, I get a TYPE MISMATCH complaint fm ASP when I do the following in trying to extract the high-order four bits. The complaint being that the
strTemp value is a string. Well, yes - it's a 1-char string.

NumTemp = MidB(strTemp,1, 1) And &Hf0

What am I doing wrong? (Something dumb, I'm sure, but ... .)

AS


Jul 19 '05 #3
"Arnold Shore" <as****@saefern.org> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...
Folks, I get a TYPE MISMATCH complaint fm ASP when I do the following in trying to extract the high-order four bits. The complaint being that the strTemp value is a string. Well, yes - it's a 1-char string.

NumTemp = MidB(strTemp,1, 1) And &Hf0

What am I doing wrong? (Something dumb, I'm sure, but ... .)


NumTemp = AscB(strTemp) And &HF0

Notes:
1. No need to extract the first character, Asc/AscB/AscW only act on the
first character in a string.
2. Here is the reference page for Asc/AscB/AscW in vbscript:

http://msdn.microsoft.com/library/en...l/vsfctasc.asp

HTH-
Chris Hohmann
Jul 19 '05 #4
Yep. Now back to my question: How do I extract the extract the high-order
four bits of a given Byte value?

The logical "And" for that requires a numeric expression, and I have a Byte.

AS

"Chris Hohmann" <hohmannATyahooDOTcom> wrote in message
news:ex**************@TK2MSFTNGP11.phx.gbl...
....
Notes:
1. No need to extract the first character, Asc/AscB/AscW only act on the
first character in a string.
2. Here is the reference page for Asc/AscB/AscW in vbscript:

http://msdn.microsoft.com/library/en...l/vsfctasc.asp

HTH-
Chris Hohmann

Jul 19 '05 #5
"Arnold Shore" <as****@saefern.org> wrote in message
news:eB**************@tk2msftngp13.phx.gbl...
Yep. Now back to my question: How do I extract the extract the high-order four bits of a given Byte value?

The logical "And" for that requires a numeric expression, and I have a

Byte.

TypeName(MidB("SomeString",1,1)) => String
TypeName(AscB("SomeString")) => Byte

Did you try the following line?

NumTemp = AscB(strTemp) And &HF0
HTH
-Chris Hohmann
Jul 19 '05 #6
an example in javascript:

<script language="javascript">

var a = 255;

alert (a & 0xf0); // should return 240

</script>


"Arnold Shore" <as****@saefern.org> wrote in message
news:eB**************@tk2msftngp13.phx.gbl...
Yep. Now back to my question: How do I extract the extract the high-order four bits of a given Byte value?

The logical "And" for that requires a numeric expression, and I have a Byte.
AS

"Chris Hohmann" <hohmannATyahooDOTcom> wrote in message
news:ex**************@TK2MSFTNGP11.phx.gbl...
...
Notes:
1. No need to extract the first character, Asc/AscB/AscW only act on the
first character in a string.
2. Here is the reference page for Asc/AscB/AscW in vbscript:

http://msdn.microsoft.com/library/en...l/vsfctasc.asp

HTH-
Chris Hohmann


Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael | last post by:
Hi, I am writting a ASP which will accept lots of data from user interface page. Is there a way that show me the each field or key name and value? For example; From the user interface page, ...
3
by: titusjava | last post by:
Hello I would like to know, is any easy way to getname of the XML tag and value of the XML tag inside a <xsl:foreach> loop. Thanks in advance Titus
6
by: charlie_M | last post by:
I figured out via various help from this forum... EXAMPLE: onClick="document.forms.MYBUTTON.value='SIMPLE';document.forms.submit()" In my CGI I see "MYBUTTON" = "SIMPLE" and this works...
1
by: Stephanie Yao via .NET 247 | last post by:
Hi, I've done something on the conversion between int32 and byte,here is my code: 1, I convert byte to an int: int regInt = BitConverter.ToInt32(regBytes, 0); this.tbRID.Text =...
1
by: Wasim Akram | last post by:
Hi, I have a field "Month" in my SQL server table. The type of this field is "tinyint". Now what I am doing in the code is using DataRow to read this field in a 'int' variable. int month...
1
by: Martin | last post by:
Dear Group Sorry for bothering you again but I need expert advice on this. I have placed a HTML textbox on my aspx form and converted it to run as a server control. At some point in my code I...
3
by: Roger | last post by:
I want to fill a combo box with a Text value to show like name, but when it is selected I want to get the say SS# or Emp #. I will be filling this in manually how should I go about this. I...
2
by: pariforum | last post by:
Pls let me know Difference between char and byte data types in core java
4
by: Jess | last post by:
Hello, I tried several books to find out the details of object initialization. Unfortunately, I'm still confused by two specific concepts, namely default-initialization and...
1
by: jyohere | last post by:
What is the difference between character and byte stream......Pls explain me in detail.......How is the internal mapping done .....its probably very difficult to understand....when we read from...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.