Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does " : " mean? 1

Status
Not open for further replies.

uconn1981

Programmer
Mar 21, 2005
42
US
Hi,

I read some code like: IL = 0: IM = 0: IR = 0.

What is ":" doing?

Thanks,

Tim
 
This line of code:

IL = 0: IM = 0: IR = 0

is doing the same as these three lines of code:

IL = 0
IM = 0
IR = 0

The colon just serves as a separator, allowing multiple code statements on one line.


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Which is usually considered bad programming practice.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
I agree with tsdragon -- don't use it. If you're maintaining old code that does use it, you should refactor your code into separate lines.

Plus, if you are able, I would suggest using real variable names. The 1980s called, and they want their two-letter variable names back. ;-)

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
The 1980s called, and they want their two-letter variable names back.

[rofl]


Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top