using AND as an IF statement


+ Reply to Thread
Results 1 to 28 of 28
  1. #1
    dw_pic's Avatar
    dw_pic Guest

    Default using AND as an IF statement

    With the picbasic IF statement being limited to a simple GOTO function, it seems to me that I remember ever being creative with in an AND statement to manipulate variables.


    i.e.

    B0 = 5 AND B1 = 10

    In english, this translates to: If B1 = 10 then load B0 with a 5

    has anyone done this or anything similar??

    Tnx,
    dw

  2. #2
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    B0 = 5 AND B1 = 10
    Well, that's not how myself or any compiler would read that statement, so you don't want to use AND. Try this:


    Code:
        IF B0 <> 5 THEN  NoSet
        B1 = 10
    NoSet:
      ' rest of program here
    What we're doing here is to establish a jump if our condition is not true. When the condition is true, we make the assigement (B1 = 10). If it is not true, we jump around the assignment to the next instruction.

    (If this seems convoluted, it is. The Pro version does not have this limit)

  3. #3
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    I think MEL basic should have a proper IF ENDIF.. So people can use good programming practices.. That better.
    Last edited by mramos; - 31st May 2006 at 11:38.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I'm pretty sure many user will learn a big deal of the previous... but we really don't need that kind of post, neither that kind of user.

    If AVR is the best one for you... use it

    If other forum have much traffic and your pleased with them... go ahead.

    Usually when i buy something, i read the specs. It all white on black in the Melabs website. There's also comparison between their PBC and PBP.

    If you'd never spend time to read it before... too bad. Buying an PBC to PBP upgrade will give you what you don't have in PBC.

    BTW, compiler battle is a common and endless story. Same in C language, in Pascal, in Basic, in.., in... in their respective forums.

    Seems kids need it... seems testosterone need to get out sometimes.

    Good luck!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No mramos, your post won't be removed - because everyone is entitled to their opinions and yours are as respected here as everyone elses provided correct decorum is observed.

    It is naive to say that company X has better chips than company Y. Atmel has a better price/performance point over Microchip is some areas, in others Microchip is the winner. It is dependant on your application.

    Forums with 'lots of traffic' could also indicate problems with the product. The biggest issue with PICBasic is folks don't read manuals or Datasheets or know electronic basics. Remove those kind of posts and there really would be no need for this forum at all!

    Likewise PICBasic is aimed at a price point. You saw (or should have) what it's specification was before you bought it. MeLabs make no secret of PBC's capabilities and it should not be a surprise when it dropped through your letterbox. The manual is freely downloadable and you should have noticed it doesn't have features like LCDOUT, although it doesn't stop you from interfacing an LCD - it's just more troublesome. If you are a professional where time is money, then you should have bought the PRO, because you will have recouped your additional outlay with the very first project.

    On the other hand, if you have a bottom-end product that is 'complete', there's really no incentive to buy the PRO version is there? So you effectively kill the sales of a product that pays the Mortgage in exchange for a product that barely keeps you fed. Selling microcontroller compilers isn't exactly a mass-market "every home must have one" product.

    I also have a product which is designed in a BASIC and a PRO version. The BASIC is exactly the same as the PRO but has all the good bits removed. Salesmen come back every day moaning that they want the features of the $3,000 product in the $900 product - and the answer is NO. If the customers want those features, then they have to buy the $3,000 product - it's what puts the jam on the bread and butter.

  6. #6
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    I EDITED the previous post, at least someone that runs the board saw it.

    And it was accurate, but that post will probably not change the issue just get flames from a few that probably own PNP. If MEL sold more compilers, there would be a lot more people here, and not all with the same problem.

    I would think, BASIC standard would be the basic compiler to learn to program ming properly with basic, and pro would allow one to expand into commercial products (added peripheral support). Which people that learned the standard would surely move into PBP once they learn. $250 is a big drop for a college student or someone looking for a hobby, so they would try the $99 program first. As a programmer, I was sortta like, how will people learn, have to invert logic to GOTO a routing. In a manual that says avoid using GOTOs, OK use THEN (that is a goto)

    It is hard to know what it does until you get it and try it. I was disappointed.
    I will use it for very small projects.

    Atmel is a better chip (speed and price wise), and coming from a $45 RVKBASIC to PBASIC, well, what can I say... I left Atmel as they did not support the Tiny11 and I had a bunch of them (it required high voltage serial programming). But now I have a bunch of 12F509s I can not use as well as PBASIC does not do them. My logic, if does the 628A, surly it was the 508/509. I should have read more. But MPLAB and PIC assembler is not all that hard, so I will use the chips.

    I will give PBASIC more time, but I think MEL is missing a big market.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    No, you should have left your post as it was. Your opinion and point of view is as valid as mine or anyone elses.

    I don't run the board... I'm nothing to do with MeLabs, or Crownhill (the nice folks who own the board), or Microchip, I'm just like you... but for my sins (which are many) and sarcasm (available in abundance) I have been awarded the God-like power of Administrator...

    Criticism is always good - as long as it is just. And I agree with your previolus comments on the limitations of PBC. I don't agree that you or others were tricked in any way into buying a $99 product because it clearly does everything that it is advertised that it can do. You can't go and buy a bottom-end Mercedes A10 and then complain it hasn't got the features and performance of a Mercedes 300SLK Turbo - yet both carry the same badge on the front.

  8. #8
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    FWIW,

    The lack of IF...THEN...ELSE...ENDIF in PBC is the most frustrating of all to be missing. I knew they weren't there when I bought and I knew for what I was doing at the time I could live without them, but the project would have came together easier with them.

    This is the only set of commands I really missed from PBC and because they are so useful I couldn't help but feel the package was a bit crippled without them. I think they should be there IMO to move PBC from "usable" to "useful".

    I've since switched to PBP so I could avoid having to work around what was missing. PBP is probably overkill for my use and PBC is underpowered, but there is no middle ground with their product. I don't care to make a switch to another product now that I am where I am, but I do understand the frustration level with PBC missing some key commands.

    Bart

  9. #9
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie
    You can't go and buy a bottom-end Mercedes A10 and then complain it hasn't got the features and performance of a Mercedes 300SLK Turbo - yet both carry the same badge on the front.
    BASIC has had "if endif" in all that I have used since 1981 (excluding GWBASIC/BASIC) , on many platforms and OSs (uC to PC, Unix, MAC, etc).

    Far as the car (if a car was basic), I agree, but I need four tires, motor, steering wheel, transmission. "IF ENDIF" to me is part of basic (and be part of a writing basic code) and good programming practice. My thought is give up the i2C for ENDIF for the beginners. If they are buying devices like 12c and LCDs they should then spend some money on the PRO version.

    My plan was to port all my Atmel RVKBASIC programs to PBASIC. Without the proper conditional form of IF ENDIF, it would take some time. I have cancelled that plan for now.

    I would rather see clean (readable) code. I did not think I was tricked, the more I read, the more I think they are after the Parallax people. That is fine, but it woud make the standard basic more like a standard basic IMHO.

    I will pop in, I love to help people, I have good status (like yours) on some of the EE forums. Sadly, I feel I am now forced now spend even more for something that I think should be in there and out the cash for the standard.

    I can make an include a 16628.inc with the ports defined and others defines for the values I need to drop in the registers, that will not be an issues, I hope it has an include function in the standard... And I will make it work for future projects. And MEL did tell me a trick to solve the lack of support for certain older pics. So I am good. Just not porting all my stuff to PICS, too much work.

    Oh yea, in that post I edited, I did remove what I think the fellow meant in his original post. Sorry. He had a typo.

    Anyway, thanks for your input.

  10. #10
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Bartman, thanks for understanding my point.. I feel the same way, that a basic command is "crippled" that should not be. The rest of it, I will work around.

    To have clean code (easy to understand, is that not why we like BASIC). It is needed.

    If I want to GOTO (jump all over) ASM has GOTO. hehehe.. The manual even
    starts walking about GOTOs all over.

    And the help files in the IDE should be broke up for better understanding.

    Again, my thoughts.

  11. #11
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mramos
    ...that a basic command is "crippled" that should not be. ...
    It's not actually crippled, it is just not developed. MELabs put less work into it, they charge less for it. As you noted, it is much closer to ASM than it is to BASIC.

    Much like ErnieM's #2 and I am sure others, here is what I did in the past. It is not quite as clean as the PBP version but is quite readable nonetheless (one extra goto per if-then)

    ;in PBP

    If X = 5 then
    x = 5
    y = 6
    z = 7
    Else
    x = 7
    y = 0
    z = 6
    Endif

    ;in PBC

    If X<>5 then Else1
    x=5
    y=6
    z=7
    goto EndIf1
    Else1:
    x=7
    y=0
    z=6
    EndIf1:


    for the next If-Then, use Else2, Endif2, etc.


    Paul Borgmeier
    Salt Lake City, Utah
    USA
    Last edited by paul borgmeier; - 1st June 2006 at 06:40.

  12. #12
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    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.

  13. #13
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    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

  14. #14
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by bartman
    Yes, you can work around them. You shouldn't have to.
    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.)

    Quote Originally Posted by mramos
    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 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.

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  15. #15
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier
    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.
    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.

    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.

  16. #16
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier
    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.)
    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.

    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

  17. #17
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Default History of PICBASIC

    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 [email protected] 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 !

  18. #18
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    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 01:28.

  19. #19
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    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

  20. #20
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Just how much would you be willing to pay for these features?

    There still ain't no such thing as a free lunch. Perhaps if there is enough interest a semi-pro version (with a few more features such as IF-THEN-ELSE) could be possible.

    However, if I ran the company, I'd stay with my two products and my 2 price points. A professional doesn't mind the price for pro (I sure didn't), and the hobbist gets a nice package that does indeed have some very fine features.


    Should a hobbist desire more power.... is there an uipgrade option, or just a re-purchase?

  21. #21
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    I do not see IF ELSE ENDIF in a programming language a feature. They all have it that I use.

    I would gladly pay $25 for an upgrade or shoot $50 so I will use it. Every compiler I have is $99 or less, except Power Basic CC and Power Basic Windows, they are major Windows 32bit program that have to deal with Microsofts contact changes and with major libraries and APIs, not like a 32 command plus PIC compiler, and they were $199 each.

    I own BASIC for Atmel (RVKBASIC), Unix (Linux and BSD), Mac OSX, PC/Windows and DOS (3 of them DOS, DOS32 bit and Windows 32bit), Palm, Motorola platform phones, and sure other I can not think of at the moment. Like I said, I love BASIC. I like PBC except for what I think it is a serious flaw for MEL and it PBC users now and future.

    And all listed above have IF ELSE ENDIF of course, that is BASIC. No I did not own a Basic Stamp. Never will. Don't need it with better tools out there.

    Funny how one points out something missing in what I think is a good product (this would make it great for the entry level product) and all of a sudden you are (by some people that do not see your point or own the PRO ersion) a bad guy, or someone that wants something for free, or are a professional tring to get something cheap.. Too funny.

    Nope. Just want to write proper basic code for the pic chip, that is all.

    C, pascal, BASIC, perl, pyton, ruby. Well I can stop, all programs I am aware of today (Since early 1990's that did not have line numbers) on any platform have if else endif.
    Last edited by mramos; - 3rd June 2006 at 00:12.

  22. #22
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    I would say $0.00 simply because the ELSE and ENDIF should be considered part of the IF...THEN command set in the first place IMO.

    While I understand the logic regarding the evolution from Basic Stamp the ability was there to complete that command set in PBC from the beginning and I feel it should have been at that time.

    In a way leaving them out is like admitting they are important commands to complete that command set because they do appear in PBP. If they weren't important why not just leave them out of PBP as well? And if they really don't make much of a difference because they can be worked around then why not include them just to save everyone a little work and make for better programming? Afterall, there is always a work around right?

    PBP has a ton of features not found in PBC that warrant the price of it. I don't think finishing the IF...THEN command set in PBC is a crazy request.

    Bart

  23. #23
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Good point Bart.

    First, I was only willing to pay to make something that does not work for me, work. And I feel I would not have any other choice otherwise.. Hummm.. That sounds fishy.. And if they are happy with it incomplete like that, it is not up to me. I know I would be happy, Bart would too, and other that own it, and future PIC (not STAMP) people too. Wonder how many gave up do to that little confussion for a non-programmer tring to learn.. Imagine they learn and they by PBP since they have not given up..

    Funny, most people that would say it is not a problem also bought PBP. And they are not dealing with it. I do not need PBP, I need IF ELSE ENDIF, not worth $150 more for what should be in BASIC of any kind, or C or PASCAL, or any other compiler. Anyway, they must have needed it too. Or maybe the people doing the ELSE1 and ENDIF1 did not buy PBP and really writing code like that to date. They can do that if they like, but I feel that is extra work for me. No offense to the people that still are, that was not meant to be mean. I just will believe you bought PBP or can really do code that way. And that is fine if you are comfortable with it, it is just not for me. I just do not want to sit and track the count on the else and endif labels. I want clean code weather standard, medium, pro, super advanced.

    Why would I buy the PBC to make things a pain and not structured? If I want a pain, I can get C for free (and it has IF ELSE ENDIF).. You like C use C, you like BASIC, use BASIC. I do not like C, I like BASIC. This to me is a broken BASIC with this one issue. What is so hard to see I need no more than PBC to do my work, but I need a proper IF ELSE ENDIF like all the other compilers I have used for the last 15+ years. Not being mean, tring to make a point.
    When the line numbers left, the ELSE ENDIF was there and made BASIC a real language. Lack of PortA etc. Not a problem, I have symbol to add them, I can "symbol PortA = 5". So that I can work with, because it is available in the PBC. But I can not add ELSE ENDIF. I have to reverse my logical thinking (at least what I call logical in my head).

    And to say work around. Work around what, the fact it is incomplete? That is what you are saying. I need a structured language.

    Final note. I am not looking to argue, just tring to get a complete program for me and others. I mean this all in the nicest way.. We really should be mailing MEL I guess. It does no good here as proven.

  24. #24
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    Talk directly to MEL. I thought PBP was/is reasonable for what it contains. It has been quite a lucrative tool for my company. As I was told,"if you don't like the cruise...Don't complain to the other passengers." Or find a better boat.

    Ron

  25. #25
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ron Marcus
    Talk directly to MEL. I thought PBP was/is reasonable for what it contains. It has been quite a lucrative tool for my company. As I was told,"if you don't like the cruise...Don't complain to the other passengers." Or find a better boat.

    Ron
    Doing exactly what you say.. I found all the others PROTON and MICROBASIC have IF ELSE ENDIF. If Microbasic is all the online manual said, I will be very happy on that boat.. And if my company would pay for my hobby, I would have pbp.. Thanks.

  26. #26
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    I don't think anyone is saying PBP isn't adaquate. We're saying PBC could be better for the hobby level with the full IF...THEN command set.

    Bart

  27. #27
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    I asked for IF ELSE ENDIF, that was it. On the PORTA.0, I can equate them with Symbol.

    I do not need anything beyond that, thought I know PBP has much more. So it is missing a complete key command that I need. Only one I saw I needed..

  28. #28
    dw_pic's Avatar
    dw_pic Guest


    Did you find this post helpful? Yes | No

    Default continued: Using AND as an IF statement

    Hi Paul,
    And thanks for your post.
    I am the originator of the post, and yours has been the closest to responding to its original meaning. Although, I have been entertained by the various responses. Thats part the fun.

    Its fun to watch a topic start and monitor its wild swings.
    I got the original PBC years ago when it first came out, and yes, I was extremely happy with it. I knew, from many programming languages previous, that the IF test statement was missing, and without it, have created many real fun projects. My latest (last winter) was an automated antenna tuner run by just one pic. It constantly monitors the frequency band of my transmitter, and pre-sets up the tuner which is located about 30 feet outside, for a low SWR on 9 different bands.

    Part of the fun for me, is being able to create something for under $50 which would haved cost me close to $400 off the shelf.

    I pondered whether to simply purchase PBP for this latest project.

    The weird thing is, I could sware that I figured out a way to make a semi- IF statement work using the AND in PBC on one of my very first projects.
    I have scratched through all of my old projects paperwork finding nothing.

    I figured, with all of the top notch programmers on this BB, that someone would have been doing something similar. Perhaps even a pre-built assembly subroutine that would simulate an IF statement.

    I guess not.
    But let the fun continue!!
    Thanks dude,
    dw_pic


    Quote Originally Posted by paul borgmeier
    It's not actually crippled, it is just not developed. MELabs put less work into it, they charge less for it. As you noted, it is much closer to ASM than it is to BASIC.

    Much like ErnieM's #2 and I am sure others, here is what I did in the past. It is not quite as clean as the PBP version but is quite readable nonetheless (one extra goto per if-then)

    ;in PBP

    If X = 5 then
    x = 5
    y = 6
    z = 7
    Else
    x = 7
    y = 0
    z = 6
    Endif

    ;in PBC

    If X<>5 then Else1
    x=5
    y=6
    z=7
    goto EndIf1
    Else1:
    x=7
    y=0
    z=6
    EndIf1:


    for the next If-Then, use Else2, Endif2, etc.


    Paul Borgmeier
    Salt Lake City, Utah
    USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts