Results 1 to 2 of 2
Thread: Setting lenght of Integer
- 03-21-2012, 08:06 AM #1Member
- Join Date
- Dec 2011
- Rep Power
Setting lenght of Integer
Is it possbile to force a integer to be 2 bytes long?
Im currently working on a application for testing PCBs with SW. The protocol for communication is made up of hex strings. I need to send hex commands with leading zeros.
Im currently hard coding the commands as int, should I use string instead? ( I have to da a CRC on them as well)
- 03-21-2012, 01:46 PM #2
Re: Setting lenght of Integer
If you want an integer value that uses 2 bytes, use the short datatype.
If you are working with Strings, there are formatting classes and methods that will insert leading "0"s
Can you give an example of the input data and the output you want?If you don't understand my response, don't ignore it, ask a question.
- By killingthemonkey in forum New To JavaReplies: 4Last Post: 10-16-2011, 08:59 PM
- By aconti in forum New To JavaReplies: 4Last Post: 07-12-2011, 08:47 AM
- By penguinSlack in forum New To JavaReplies: 1Last Post: 03-14-2011, 05:08 AM
- By diskhub in forum New To JavaReplies: 6Last Post: 05-17-2010, 12:50 AM
- By javastuden in forum New To JavaReplies: 3Last Post: 12-04-2009, 10:37 AM