Is it possible to put multiple values in one "case" (like in Pascal), not only an interval ? I tested
Case 25, 20, 15 : ...
It does not compile. Is there any possibilty, or should I put a new "case" for each value (and repeat the instructions) ?
( 'Case 25, 20, 15, 1 to 10 : ' would even be better. Sorry, 30 years of Pascal leave traces ... :) )
Thanks for any anwer ...
Last edit: Bertrand BAROTH 2018-12-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Pascal was my favourite language. It always struck me as an extremely elegant yet efficient programming language. I programmed in 'Object Pascal' (Borland's Delphi) for many years.
Such a shame that the 'dotnet' programming languages became more popular. The simplicity of writing a Windows program in Delphi seemed to get lost somehow in the 'VB.net' type languages. Everything became an overcomplicated 'Project' that never made any sense to me. Once Borland began to embrace the '.net' methods I lost all interest. It confused me in much the same way that MicroChip's MPLab still does today. I simply could not then, and still cannot now, see how to get started. Earlier versions of Delphi seemed far simpler: Draw the 'Form' (User interface - or 'Window') and then add the code to the buttons, text boxes and so on. Compile. Test. Done. Simple.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried delph, on win 98 I think...bit vague now, it was like vb but free and made an exe. file, if I remember.
I discovered basic with a zx81...its basic didn't have case. How did we get on without it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used Visual Basic (V1) on Windows 3. It's main problem was that programs built using it only ever worked on about 80% of installs. On the others you would have DLL incompatibilities that left your (my!) program non-working. Drove me insane trying to fix them. That's why I went for Delphi. It did (as you said) compile into a fully working .exe that worked flawlessly on almost any system. Programs I wrote for Windows '95 are still working today, on Windows 10.
Delphi also had the incredible support of Huw Collingbourne in PcPlus Magazine. His articles were truly inspirational. I learned (copied wholesale!) so much from his writing. I hope Borland repaid him well. I won a copy of Delphi 7 Professional through his articles. I didn't care for V7 and persuaded Borland to let me have a Professional Licence for Delphi 6 in it's place. I think V7 was the first to have Kylix support, and I really failed to understand it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I started with Delphi v1.0 and I'm still using (more dabbling with these days) Delphi. You can get the complete (minus some sourcecode) "Professional" multi-platform version for free for non-commercial/restricted commercial use - see https://www.embarcadero.com/products/delphi/starter ). I also used Kylix back in the day to create FreeBSD versions of Delphi Windows programs; and Lazarus to create OS X versions; of course, now Delphi can do macOS too (32 bit at present, but 64 bit coming).
Dragging this back from PCs to PICs, I also use MikroElektronika's MikroPascal Pro for 8 bit PICs.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a brief look at MikroPascal some years back. I think I became confused by what was required to program the PIC device. I ended up going to Revolution Education's PicAxe devices. The language (a dialect of BASIC) was simple to understand, I could see what was required to write and compile the code (which worked in Windows and on a Mac) as well as what was required to program the devices (which also worked in Windows and on a Mac). I could also immediately see what was required to incorporate the devices into 'finished' circuits. Essentially (and crucially) nothing more than the device itself.
After some years, I designed a unit that was supposed to detect falling objects about the size of a 2cm ball. I used a PicAxe as the controller, I ran some quick calculations as to how long this object would be in range of my detector and thought that the PicAxe would be very nearly quick enough, but not quite. The prototypes worked, but I wasn't confident that they wouldn't miss a few wouldn't fall through the detector un-noticed. Looking for a replacement was easy, I looked towards the 'base' PIC device the PicAxe I'd used was built upon, a 16F1825.
And that led me here. I've used Great Cow Basic almost exclusively ever since. For the occasional job where speed of development trumps execution speed, PicAxe wins hands down due in no small part to the wonderful simulator that Revolution Education provide. For anything where I am likely to need faster speed then the PIC wins, having often proven the design using a PicAxe and the simulator, before switching to the base PIC for the later stages of development.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
going off topic.
My first basic pic compiler was a prototype by Nigel Goodwin written with delphi.
I think freebasic is good for win programs. It makes a stand alone .exe compiled file and can include files.
I was misled by picaxe "compiler". The interpreted code is slowww.
Using a 28x2 picaxe is complicated compared to using it's pic 18f25k22 equivalent with gcb.
I got a ssd1306 to work with picaxe and posted on their forum, but it was slow compared to same display using gcb. It used nearly all variables. picaxe variables are so limited...you use peek/poke.
I bought into picaxe from searching for"basic pic compiler" without finding great cow basic until 6 months later. Dunno how that happened.
Misled by picaxe inline assembler..not a way of speeding code execution-it's interpreted.
I think gcb will become more popular as people discover it... and picaxe won't.
When I first used gcb it was with a uno as I was awaiting pickit from ebay. I didn't think I could get my old parallel port programmer to work with gcb.
So I tried the uno thinking this won't work but it did.
I couldn't write a "sketch" for a uno but a basic program is easy with gcb, so although not a "micro controller chip" is a lot more representative of one than picaxe imho.
I never used picaxe simulator. There's picsimlab that runs gcb quite well but I don't use simulators if they look hard to learn.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello ...
Is it possible to put multiple values in one "case" (like in Pascal), not only an interval ? I tested
Case 25, 20, 15 : ...
It does not compile. Is there any possibilty, or should I put a new "case" for each value (and repeat the instructions) ?
( 'Case 25, 20, 15, 1 to 10 : ' would even be better. Sorry, 30 years of Pascal leave traces ... :) )
Thanks for any anwer ...
Last edit: Bertrand BAROTH 2018-12-29
We can 'TO range to Select Case' from v0.98.00 (see the Help) but we do not support Case 25, 20, 15 types.
A new case may be needed, but, call a Sub or Macro rather than repeat the code.
Thanks for the answer. Maybe that in a future version ... It could be fine !
Try this!!!
Compiles... but, does not work. :-(
Last edit: Anobium 2018-12-29
Pascal was my favourite language. It always struck me as an extremely elegant yet efficient programming language. I programmed in 'Object Pascal' (Borland's Delphi) for many years.
Such a shame that the 'dotnet' programming languages became more popular. The simplicity of writing a Windows program in Delphi seemed to get lost somehow in the 'VB.net' type languages. Everything became an overcomplicated 'Project' that never made any sense to me. Once Borland began to embrace the '.net' methods I lost all interest. It confused me in much the same way that MicroChip's MPLab still does today. I simply could not then, and still cannot now, see how to get started. Earlier versions of Delphi seemed far simpler: Draw the 'Form' (User interface - or 'Window') and then add the code to the buttons, text boxes and so on. Compile. Test. Done. Simple.
I tried delph, on win 98 I think...bit vague now, it was like vb but free and made an exe. file, if I remember.
I discovered basic with a zx81...its basic didn't have case. How did we get on without it?
I used Visual Basic (V1) on Windows 3. It's main problem was that programs built using it only ever worked on about 80% of installs. On the others you would have DLL incompatibilities that left your (my!) program non-working. Drove me insane trying to fix them. That's why I went for Delphi. It did (as you said) compile into a fully working .exe that worked flawlessly on almost any system. Programs I wrote for Windows '95 are still working today, on Windows 10.
Delphi also had the incredible support of Huw Collingbourne in PcPlus Magazine. His articles were truly inspirational. I learned (copied wholesale!) so much from his writing. I hope Borland repaid him well. I won a copy of Delphi 7 Professional through his articles. I didn't care for V7 and persuaded Borland to let me have a Professional Licence for Delphi 6 in it's place. I think V7 was the first to have Kylix support, and I really failed to understand it.
I started with Delphi v1.0 and I'm still using (more dabbling with these days) Delphi. You can get the complete (minus some sourcecode) "Professional" multi-platform version for free for non-commercial/restricted commercial use - see https://www.embarcadero.com/products/delphi/starter ). I also used Kylix back in the day to create FreeBSD versions of Delphi Windows programs; and Lazarus to create OS X versions; of course, now Delphi can do macOS too (32 bit at present, but 64 bit coming).
Dragging this back from PCs to PICs, I also use MikroElektronika's MikroPascal Pro for 8 bit PICs.
I had a brief look at MikroPascal some years back. I think I became confused by what was required to program the PIC device. I ended up going to Revolution Education's PicAxe devices. The language (a dialect of BASIC) was simple to understand, I could see what was required to write and compile the code (which worked in Windows and on a Mac) as well as what was required to program the devices (which also worked in Windows and on a Mac). I could also immediately see what was required to incorporate the devices into 'finished' circuits. Essentially (and crucially) nothing more than the device itself.
After some years, I designed a unit that was supposed to detect falling objects about the size of a 2cm ball. I used a PicAxe as the controller, I ran some quick calculations as to how long this object would be in range of my detector and thought that the PicAxe would be very nearly quick enough, but not quite. The prototypes worked, but I wasn't confident that they wouldn't miss a few wouldn't fall through the detector un-noticed. Looking for a replacement was easy, I looked towards the 'base' PIC device the PicAxe I'd used was built upon, a 16F1825.
And that led me here. I've used Great Cow Basic almost exclusively ever since. For the occasional job where speed of development trumps execution speed, PicAxe wins hands down due in no small part to the wonderful simulator that Revolution Education provide. For anything where I am likely to need faster speed then the PIC wins, having often proven the design using a PicAxe and the simulator, before switching to the base PIC for the later stages of development.
going off topic.
My first basic pic compiler was a prototype by Nigel Goodwin written with delphi.
I think freebasic is good for win programs. It makes a stand alone .exe compiled file and can include files.
I was misled by picaxe "compiler". The interpreted code is slowww.
Using a 28x2 picaxe is complicated compared to using it's pic 18f25k22 equivalent with gcb.
I got a ssd1306 to work with picaxe and posted on their forum, but it was slow compared to same display using gcb. It used nearly all variables. picaxe variables are so limited...you use peek/poke.
I bought into picaxe from searching for"basic pic compiler" without finding great cow basic until 6 months later. Dunno how that happened.
Misled by picaxe inline assembler..not a way of speeding code execution-it's interpreted.
I think gcb will become more popular as people discover it... and picaxe won't.
When I first used gcb it was with a uno as I was awaiting pickit from ebay. I didn't think I could get my old parallel port programmer to work with gcb.
So I tried the uno thinking this won't work but it did.
I couldn't write a "sketch" for a uno but a basic program is easy with gcb, so although not a "micro controller chip" is a lot more representative of one than picaxe imho.
I never used picaxe simulator. There's picsimlab that runs gcb quite well but I don't use simulators if they look hard to learn.