Offline
Newbie
Karma: 0
Posts: 5
|
 |
« on: February 13, 2012, 03:48:43 pm » |
after spending an hour on trying 2 type a program from the getting started book ive learnt the importance of capitals in the correct place and also with or without val in brackets.for example 02 it seems the way val is written ,int val = 0; and in, if (val == high ); and val = digitalRead determins if the program will verify.in some places a capital v dosnt seem to matter and in others it does.its very confusing.also the online 02 turn on led button while button pressed isnt the same as the book version with one using val and the other buttonstate or am i missreading it.hopefully the next example will prove easier.many thanks from richard
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 87
Posts: 9377
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #1 on: February 13, 2012, 04:31:50 pm » |
Most computer languages today are case sensitive and it is a matter of style what to use. Just try to be consequent in your style as that improves readability when you see your own code in 6 months 
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #2 on: February 13, 2012, 07:41:16 pm » |
Just try to be consequent in your style Or consistent... 
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15312
Measurement changes behavior
|
 |
« Reply #3 on: February 13, 2012, 07:56:48 pm » |
Capitalization is the difference between "I had to help my uncle Jack off a horse.." and "I had to help my uncle jack off a horse.."
Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Salem, Oregon
Offline
Full Member
Karma: 0
Posts: 175
Arduino rocks but sometimes it rolls
|
 |
« Reply #4 on: February 13, 2012, 08:45:55 pm » |
Capitalization is the difference between "I had to help my uncle Jack off a horse.." and "I had to help my uncle jack off a horse.."
Lefty
<comic book guy>Best....Reply....Ever....</comic book guy> My apologies, I couldn't help it. Brad.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15312
Measurement changes behavior
|
 |
« Reply #5 on: February 13, 2012, 08:49:56 pm » |
Capitalization is the difference between "I had to help my uncle Jack off a horse.." and "I had to help my uncle jack off a horse.."
Lefty
<comic book guy>Best....Reply....Ever....</comic book guy> My apologies, I couldn't help it. Brad. No problem, that's was the effect I was going for. You don't know how long I've keep that little beauty under wrap waiting for the proper straight line to use it.  Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Austin, TX
Offline
Faraday Member
Karma: 41
Posts: 5165
CMiYC
|
 |
« Reply #6 on: February 13, 2012, 08:59:02 pm » |
Are you being ironic with your post, or is your shift key broken?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #7 on: February 14, 2012, 01:13:34 am » |
after spending an hour on trying 2 type a program from the getting started book ive learnt the importance of capitals in the correct place ...
Capitals are important in English too, you know. You start a sentence with a capital. The word "I" is capitalized, as is "I've". "trying 2 type" doesn't make sense. Do you mean "trying to type"? http://cynthia-jones-shoeman.suite101.com/sloppy-writing-says-you-dont-care-enough-a124537"I had to help my uncle Jack off a horse.." A search for that finds a lot of pictures of horses, and uncles. 
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 271
Posts: 25433
Solder is electric glue
|
 |
« Reply #8 on: February 14, 2012, 03:20:35 am » |
in some places a capital v dosnt seem to matter and in others it does.its very confusing. It always matters. Where you may think it dosn't is the names of variables, and functions, but these have to be consistant. But by convention if a variable is in all capitals it is a constant given by a #define. A single = is an assign, make this equal to that. A double == is a logical comparison, is this equal to that? If the OP wants to ask nan thing specific then please do.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #9 on: February 14, 2012, 04:11:07 am » |
thank you all for your helP HinTs and tipS.when i was young none of this existed until the sinclair mk14 appeared in the 60,s for home constructers and useres? the :smiley-sleep:n the zx80/81.i still have some of these which use basic as a programming language so may dig one out,make an interface and try my hand.many thanks from richard x bernie
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19007
I don't think you connected the grounds, Dave.
|
 |
« Reply #10 on: February 14, 2012, 04:15:13 am » |
sinclair mk14 appeared in the 60, Out by at least 10 years. The technology for the Mk14 at that price-point didn't exist until at least the mid 70s. BTW, you do know that capitalising titles is considered online to be shouting, and rude, don't you?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #11 on: February 14, 2012, 04:53:52 am » |
Re: THE IMPORTANCE OF CAPITALS ... thank you all for your helP HinTs and tipS
Surely you jest?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 271
Posts: 25433
Solder is electric glue
|
 |
« Reply #12 on: February 14, 2012, 06:51:12 am » |
The technology for the Mk14 at that price-point didn't exist until at least the mid 70s. Well 1977 according to this:- http://en.wikipedia.org/wiki/MK14
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19007
I don't think you connected the grounds, Dave.
|
 |
« Reply #13 on: February 14, 2012, 06:54:07 am » |
http://en.wikipedia.org/wiki/SC/MPThe SC/MP from National Semiconductor is an early microprocessor, which became available in early 1974. That's pretty close to mid-70s, I think.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 271
Posts: 25433
Solder is electric glue
|
 |
« Reply #14 on: February 14, 2012, 06:56:34 am » |
Yes I was still in my mid 50s when I was 57. 
|
|
|
|
|
Logged
|
|
|
|
|
|