Read Fixed Length Fields From MSMQ

retchason

New member
Joined
Jun 24, 2009
Messages
1
Programming Experience
Beginner
I have an old application that I ported over from and old DEC PDP-11 written in FORTRAN to VB.Net VS2005. I will be communicating with our buisness systems using MSMQ. The problem that I have is that they will be sending me a fixed length file with fixed length strings in it. I am confused on how to do this. In FORTRAN it was easy. I would create a structure similiar to this:

Structure /Message/
CHARACTER*8 Msg_Id
UNION
MAP
CHARACTER*23 Date
CHARACTER*10 Coil_Id
CHARACTER*4 Unit_Code
......
CHARACTER*100 Comments
END MAP
MAP
CHARACTER*512 WHOLE_MSG
END MAP
END UNION
End Structure

In Fortran I would receive the this message in a buffer defined as CHARACTER*512 and then insert into the data structure like this:

Structure /Message/myMessage

myMessage.WHOLE_MSG = buffer

Now I can access each element of the structure like this:

myMessage.Date
myMessage.Unit_Code

I have searched the web for solutions and have not really found a clear simple explanation. Can anyone give be advise on how to do this. I am new to VB.NET.

Additionally, I need to write a fixed length record out to the body of a MSMQ message to send back to our buisness system.

:confused:
 
Back
Top