I used to use fixed-length strings

J

Jim Corey

I have to parse a bar code. Back in VB6, I can remember putting a
string into a structure that had members with fixed-length strings and
then I could pick off the memebers by name.

But we can ignore that if there's a better idea. I simply would like to
create a technique to parse the bar code that will be easily portable.
I could keep a set of constants that
would contain the start position and length of each field within the bar
code, but I'm thinking there's a slicker way to do it.

TIA,
Jim
 
L

Larry Serflaten

Jim Corey said:
I have to parse a bar code. Back in VB6, I can remember putting a
string into a structure that had members with fixed-length strings and
then I could pick off the memebers by name.

But we can ignore that if there's a better idea. I simply would like to
create a technique to parse the bar code that will be easily portable.
I could keep a set of constants that
would contain the start position and length of each field within the bar
code, but I'm thinking there's a slicker way to do it.

Not having worked with bar codes, I am not sure of exactly what you
need, but look up the FieldOffsetAttribute in VS Help. It basically
allows you to declare a structure where two or more fields share the
the same memory....

Another example can be found when you look up 'Unions Sample'
in VS Help.

HTH
LFS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top