Solved

equivalent of Chr$(ETX)...?

Posted on 2001-06-13
8
1,023 Views
Last Modified: 2008-02-01
Hi all,
  I am developing an application that sends command to machine and receives information from it.
In Visual Basic, I used  'Chr$(ETX)' to check if it is end of transmission.
But I have no idea on how to do if with Java prgm.
Does anyone know what is the equivalent code/method in JAVA?

Thanks alot
0
Comment
Question by:Howard888
  • 5
  • 3
8 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 5 total points
ID: 6190266
to get the ETX char in java, you would use:

  (char)3

OR:  more readable:

private static final char ETX = (char)3 ;

then you can just check if the character you read in equals ETX

if( charIn == ETX )
  // end of transmission...

Hope this helps, and is right ;-)

Good Luck!!

Tim.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 6190267
hehehe...  5 points ;-)

10 times easier than easy?

;-)

Tim.
0
 
LVL 92

Expert Comment

by:objects
ID: 6190468
Go Tim :)
0
 
LVL 92

Expert Comment

by:objects
ID: 6190475
And I won't tell anyone that you know VB.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 35

Expert Comment

by:TimYates
ID: 6190503
EEEK!  Thank god..  I was about to offer you money ;-) hehehe
0
 
LVL 35

Expert Comment

by:TimYates
ID: 7171281
Woo woo!!  I got a grade C!!  HAHAHAHAHAH!!!

Remind me never to do anything less than 50 points again...it's not worth scuffing the skin off my fingertips on my keyboard for... ;)

Ta

Tim.

0
 
LVL 92

Expert Comment

by:objects
ID: 7173173
Tim,

I would have given you an 'A'.

mick
0
 
LVL 35

Expert Comment

by:TimYates
ID: 7173730
Cheers fella :-)  Hee hee, and thanks for not telling anyone about my VB knowledge ;)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now