Jump to content

Match String function error


grmc

Recommended Posts

The match string function does not work when trying to match the Hexadecimal string C8 2B.

It will only return C8 as a match.

2959[/snapback]

If you convert the search string from hex display to \code display you will see that 2B is a + sign.

If you look up the help on the match pattern and click on the special characters link you will see that a + is a special character. It also say that in order to search for a + it must be proceeded by a \ (5C hex)

post-584-1102395658.png?width=400

post-584-1102395740.png?width=400

post-584-1102395763.png?width=400

Link to comment
If you convert the search string from hex display to \code display you will see that 2B is a + sign.

If you look up the help on the match pattern and click on the special characters link you will see that a + is a special character. It also say that in order to search for a + it must be proceeded by a \ (5C hex)

post-584-1102395658.png?width=400

post-584-1102395740.png?width=400

post-584-1102395763.png?width=400

2960[/snapback]

Yes I am aware of that, but the fact remains that the Match String function does not differentiate between a hexadecimal input and a string input. One would expect that when looking for a hexidecimal string, the string would be matched exactly as it appears.

Link to comment
Yes I am aware of that, but the fact remains that the Match String function does not differentiate between a hexadecimal input and a string input. One would expect that when looking for a hexidecimal string, the string would be matched exactly as it appears.

3002[/snapback]

Ok, We want to use the power of the search string primitive which is designed for normal strings but send it hex display values.

How about a hex to normal and a normal to hex converter.

post-584-1103005086.png?width=400

If anyone has a more elegant way of converting strings I would be interested in seeing it.

Download File:post-584-1103005348.llb

Link to comment
Yes I am aware of that, but the fact remains that the Match String function does not differentiate between a hexadecimal input and a string input. One would expect that when looking for a hexidecimal string, the string would be matched exactly as it appears.

3002[/snapback]

The wires on the diagram don't have any formatting information from the control which data comes from. That's perfectly alright because the actual content of a control is not affected by how data is displays. I wouldn't like if a number was modified by the number of digits of precision it is displayed on the control... The same applies to string display. There is no so called difference between hexadecimal and string input. That's the same data with different display format for the user's eye only.

However, if you want to use the string as it is displayed, you can use the Text.Text property:

post-447-1103031980.gif?width=400

This property is the string content as it is displayed in the control. This is the exact formatted content, including the space separator every 4 character.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.