That will work if you have 3-5 IF ELSE ENDIF. Also, you might want to indent the code between the IF ELSE ENDIF.
But it will make extra work.
That will work if you have 3-5 IF ELSE ENDIF. Also, you might want to indent the code between the IF ELSE ENDIF.
But it will make extra work.
I don't quite agree with you Paul.
It is called "BASIC" and Basic commands are missing. I was using proper IF...THEN...ELSE...ENDIF 20 years ago when I learned Basic so to me it is rather incomplete without them. Yes, you can work around them. You shouldn't have to.
As mentioned, there are other commands which aren't so "Basic" that could have been saved for PBP that are included with PBC. The trade off isn't the most useful I don't think.
Bart
You do not have to - upgrade to PBP and problem solved! (That is what I did half a decade ago. Upgrading to PBP costs you no more than starting with PBP.)Originally Posted by bartman
I do not see why you are limited to 3-5 IF's - you should only be code space limited. Just increase the number for each Else EndIf and all will be well. Yes, it is a little extra work - I was just providing a work around that worked for me. As noted above, I solved my problem by upgrading and could not be happier.Originally Posted by mramos
Paul Borgmeier
Salt Lake City, Utah
USA
No, I meant I personally would not go more than 3-5 (scratching the last number on a post-it note), I would get lost in my ELSE1/2/3/4 counts and generate more headaches.Originally Posted by paul borgmeier
Anyway, I like Paul feel, leave out non-basic stuff so people will want the PBP, and let the basic be BASIC. The idea of basic, it to make it simple and teach beginners programming, without IF ENDIF structure, the code looks back, and would confuse a beginner.
And in the last 20 years, BASIC evolved. It would be nice to see PBC do it as well.
I wanted to port my Atmel programs over, but the free RVKBASIC has both like PBP, since it is a BASIC compiler for microcontrollers.
But thanks for the idea, I have done it that way in the pass, a VERY long time ago. I could write a pre-processor to fix it, since I have no symbolic debugger I guess. I have no project at this time (do to the IF ENDIF issue). But if I get a new one I will look at the PBC again and the pre-processor option.
I would think there are conditions when they compile PBC and PBC that it could be turned on easly, maybe a wist list on this forum?
I can not imagine Paul and I are the only two, no there are another fellow.
The Admin here is a "VERY" fair person and do not think she will be offened.
I did upgrade. That's not the point I'm trying to make. They are Basic statements and they should be part of of Pic BASIC to begin with. Code is confusing and messy using work arounds. The key word here is BASIC. Don't call it BASIC if the basic commands aren't there.Originally Posted by paul borgmeier
Call it "The Incentive to Upgrade sort of like Basic, but not really" software package. I shouldn't need to buy a pro version to do basic things using commands that have been part of the Basic language for a very long time.
My first project was very, VERY simple and straight forward and really amounted to no more than flashing LEDs, but it was very frustrating writing it without those commands and I knew going in they were missing. I can feel the pain of anyone who expects a Basic command set, but gets only half of the important one. That is the point I'm trying to make.
It is really sad that I had to upgrade to get that command set for my next project which was more complex, but still very simple. Hobby only, but I had to move up to a pro version to do it? Seems wrong.
Bart
Hi, Just trying to help out.
History is sometimes a good lesson.
Even though it looks like mELabs has a "bait and switch" reason to have two compilers for PICBASIC.
People coming to PICBasic Compiler from a BASIC language background would surely suspect a deliberate withholding of features.
People who have watched the PIC Microchip family evolve, see a different reason.
My interpretation of history lived:
-------------
BASIC Stamp I (PIC Microchip on board)
http://www.parallax.com/
Parallax, Inc "1992 - Original BASIC Stamp 1 Rev. D released in through-hole format on PCB with prototype space and battery clip."
BASIC Stamps are made with PIC Microchip microcontrollers (PICs).
Some of the peripheral devices, allow the BASIC Stamp (Stamp) to do very useful things. These same useful things, can be done by a PIC with similar devices, added (if these functions are needed).
Other peripheral devices, built into the BASIC Stamp allow it to "translate" BASIC typed into a PC and fed into the Stamp. The Stamp carries it's translator with it and this translation slows it down. The PIC, inside the stamp, takes each piece of code (token) and changes the BASIC token to PIC language. This is very nice because PIC code is a bear to learn. But slow.
Then:
Along comes microEngineering Labs, Inc. and a PC program that "compiles" BASIC to PIC code, INSIDE the PC! Then it is squirted into the PIC. Then the PIC has native PIC code and can run 10 times faster. This frees up a LOT of space reserved for the translator.
BASIC Stamp 1 and PICBASIC™ Compiler
-------
http://www.crownhill.co.uk/product.php?prod=18
Crownhill Associates Ltd.
The PicBasic Compiler instruction set is compatible with the Parallax BASIC Stamp I. BS1 programs can be compiled into PICmicro MCU code and programmed directly into a PICmicro MCU, eliminating the need for a BASIC Stamp module. These programs execute much faster and may be longer than their Stamp equivalents. They may also be protected so no one can copy your code. Other benefits include substantial cost savings over a BASIC Stamp.
----------
microEngineering Labs, Inc.
http://www.melabs.com/
standard PICBASIC™ Compiler (First page, see the introduction.)
http://www.melabs.com/resources/pbcmanual/
PBC also allows programs written for the original BASIC Stamp I to be compiled for direct execution on members of the PIC16Cxxx family of microcontrollers.
---------------
Then BASIC Stamp 2:
Parallax, Inc.
http://www.parallax.com/html_pages/c...ry/history.asp
"1995 - BASIC Stamp 2 module is released amid much excitement and long-standing backorders around the world."
------------
microEngineering Labs, Inc.
http://www.melabs.com/
PICBASIC PRO™ (First page)
http://www.melabs.com/resources/pbpmanual/
1. Introduction
The PICBASIC PRO™ Compiler (or PBP) is our next-generation programming language that makes it even quicker and easier for you to program Microchip Technology=s powerful PICmicro microcontrollers. The English-like BASIC language is much easier to read and write than the quirky Microchip assembly language.
The PICBASIC PRO™ Compiler is a BASIC Stamp II like@ and has most of the libraries and functions of both the BASIC Stamp I and II. Being a true compiler, programs execute much faster and may be longer than their Stamp equivalents.
PBP is not quite as compatible with the BASIC Stamps as our original PicBasic Compiler is with the BS1. Decisions were made that we hope improve the language overall. One of these was to add a real IF..THEN..ELSE..ENDIF instead of the IF..THEN(GOTO) of the Stamps. These differences are spelled out later in this manual.
++++++++++++++++++
My view:
After Parallax released the BASIC Stamp II they did not go back and improve the on board interpreter enough to change the BASIC Stamp I code.
All of these things, are referred to on the web sites and in the manuals. But, it would be easy to miss if you don't really know where the names of the products came from.
The BASIC in the PICBASIC Compiler name is referencing the BASIC Stamp I (PIC Microchip on board).
I am just happy to get a real IF..THEN..ELSE..ENDIF in PicBASIC Pro!
-Adam-
Ohm it's not just a good idea... it's the LAW !
They would probably get a lot more PIC programmers that want to do quicker small projects and even Stamp I people to get PBC if word was out that it had a current basic IF ELSE ENDIF to make programming cleaner and easier. Two new groups. Heck a Stamp II person might go, I will I will try the PIC chips.
It is just like Bart said it is sad. What is also sad nothing has been brought up about maybe until now? It has been around for years. Maybe that will be an enhancement in the next PBC, not because a couple people spoke up about it, but the new customers they could attract. There are probably more pic programmer out there that Stamp programmers, or close. I can program in assembler, but I really like BASIC, it is one everything electronic I have, down to my Treo 650 cellphone (and yep, has IF ELSE ENDIF).
If you want to get more non-Stamp programmers (I have never touched a Stamp and would never have thought this was normal, but do see their ads).
I was looking for a BASIC compiler for the PIC? I bought it in 1996 and never used it, Went the Atmel way. It is a new market for them for sure. Just because Parallax missed the boat, no reason for a good compiler to miss it as well. Just silly.
I bought it because it was a basic compiler for the PIC micro and I was going to try the new PICS (I still had 16C84 and 12C508 stored away), I usually use Atmel. I see this is a serious missing command for good code writing. I actually told someone a coulpe days ago to learn assembler (and he has start and doing pretty good) because otherwise he would have to spend $250 for a compiler to do/learn what he wants. This was after I received mine and went what the heck... I told him it was missing IF ENDIF, and told him I have PBC and would make it work, but could only recommend PBP for a beginner (does that not sound backwards). And he choose assembler on his own with other asm people mailing him too. And I went on about basic to him for days..
BTW, thanks for the history, I see why it is weird like that now. It is too bad they did not fix it, so they would have better product and be more like what BASIC programmers 1990s and 2000s and not BASIC Stamp programmers use. I would use it a lot if it worked like all the basic compilers I use. Hahaha.
Last edited by mramos; - 2nd June 2006 at 02:28.
Adam,
Thanks for that bit of history. From that standpoint I see how it got to where it got. Since I have never used Basic Stamp and came straight through to PBC Basic to me it should still be Basic with these common commands.
While I acknowledge the manual where it talks about Basic Stamp and how/what changes to make for PBC I never got the idea that PBC was the off-shoot of Basic Stamp. I read it to imply that PBC was something new and Basic Stamp users might want to make the jump for reasons A,B and C. I assumed, which I acknowledge is never a good idea, this "better" system brought a larger command set along with it hence another reason why the Stamp people would want to migrate to PBC.
I still believe the full IF...THEN...ELSE...ENDIF command set should be included in PBC to make it more useful for new users. The pro version has a lot of bells and whistles that most hobbyists will never touch, but have to pay for to get some nice basic commands. Not everyone is doing this to make money so coming up with money for the pro version is a big deal for a little hobby.
Bart
Bookmarks