Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

equivalent of Chr$(ETX)...?

Posted on 2001-06-13
8
Medium Priority
?
1,046 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 10 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 92

Expert Comment

by:objects
ID: 6190475
And I won't tell anyone that you know VB.
0
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

783 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