|
Forum Index : Microcontroller and PC projects : DO:UNTIL....
| Author | Message | ||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Well now I remember (RTFM) that it's either DO WHILE:LOOP or DO:LOOP UNTIL but of course I forgot and was scratching my head for a bit. Would it be a good idea to have the interpreter pick-up on this and flag an error message? My DO UNTIL Pin(22) = 0 : LOOP Just sat there looping away. Board: E100 MM.VER:5.0501 |
||||
| twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1672 |
BTW. DO WHILE:LOOP or DO:LOOP UNTIL are explained in the manual. But this also works: Do:Loop While Inkey$<>Chr$(ENTER) Michael causality ≠ correlation ≠ coincidence |
||||
| PicFan Senior Member Joined: 18/03/2014 Location: AustriaPosts: 133 |
Maybe . . . DO WHILE(PIN(22) = 0) . . . . . . LOOP |
||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Oh sure but that would need to be PIN(22) = 1 I used the other option: DO . . LOOP UNTIL PIN(22) = 0 |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
This is one of the problems with working in the small memory space of a microcontroller. There are many, many ways of incorrectly constructing a command and it is impossible to trap them all and still fit in the given flash memory space. Already error checking takes up a lot of space (I guess about 20%) and that is only trapping the obvious errors. Compilers like C and C++ have the advantage here because they are running on a desktop computer with almost unlimited memory. But then they have other disadvantages as well. Geoff Graham - http://geoffg.net |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |