Shop OBEX P1 Docs P2 Docs Learn Events
PBasic Wishlist Item — Parallax Forums

PBasic Wishlist Item

ArchiverArchiver Posts: 46,084
edited 2004-04-26 17:21 in General Discussion
As long as we're on the subject, it would be
REALLY nice if the IF statement could include
IF condition THEN GOSUB xxxxxx
Would simplify a lot of code for me. Any chance
of getting this in the *next* version of PBasic??;-)
Tom Fisher
Dallas,TX

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 17:44
    At 11:24 AM 4/25/04 -0500, tboonefisher wrote:
    > As long as we're on the subject, it would be
    >REALLY nice if the IF statement could include
    >IF condition THEN GOSUB xxxxxx
    >Would simplify a lot of code for me. Any chance
    >of getting this in the *next* version of PBasic??;-)
    >Tom Fisher
    >Dallas,TX
    >
    >IF NOT condition then branch_around
    >GOSUB XXXXX
    >Branch_around:


    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and Body of the message will be ignored.
    >
    >Yahoo! Groups Links
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 17:45
    You can do that (for over a year) now, Tom. Just select PBASIC 2.5
    syntax.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: tboonefisher [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=kKehISGSDXeXJ5p1jnBaqkOYkaoQE9erL4LFB84jkqch-ls37INEAFQaHY32lTDMVLSmYkDmojCdz5wAyg]tboonefisher@s...[/url
    Sent: Sunday, April 25, 2004 11:24 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] PBasic Wishlist Item


    As long as we're on the subject, it would be
    REALLY nice if the IF statement could include
    IF condition THEN GOSUB xxxxxx
    Would simplify a lot of code for me. Any chance
    of getting this in the *next* version of PBasic??;-)
    Tom Fisher
    Dallas,TX
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 17:52
    Really, gang, it's much easier than that -- and since telling the group
    doesn't seem to do any convincing, let me PROVE it. Copy and paste this
    demo into your BASIC Stamp editor:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    cntr VAR Nib

    Main:
    DEBUG HOME, DEC2 cntr
    IF (cntr.BIT0 = 1) THEN GOSUB Is_Odd
    DEBUG CLREOL, CR
    cntr = cntr + 1
    PAUSE 500
    GOTO Main

    Is_Odd:
    DEBUG " is odd"
    RETURN


    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Bruce Bates [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9i7BE679IdU5jlTTIwpdHldS7p_jV4ZwLEH7siro1d7hkRaBFFqHcwkhUIc8sOAtLhe-dq3Qcr-I7J4z]bvbates@u...[/url
    Sent: Sunday, April 25, 2004 11:44 AM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item


    At 11:24 AM 4/25/04 -0500, tboonefisher wrote:
    > As long as we're on the subject, it would be
    >REALLY nice if the IF statement could include
    >IF condition THEN GOSUB xxxxxx
    >Would simplify a lot of code for me. Any chance
    >of getting this in the *next* version of PBasic??;-)
    >Tom Fisher
    >Dallas,TX
    >
    >IF NOT condition then branch_around
    >GOSUB XXXXX
    >Branch_around:
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 17:55
    --- In basicstamps@yahoogroups.com, Bruce Bates <bvbates@u...> wrote:
    > At 11:24 AM 4/25/04 -0500, tboonefisher wrote:
    > > As long as we're on the subject, it would be
    > >REALLY nice if the IF statement could include
    > >IF condition THEN GOSUB xxxxxx
    > >Would simplify a lot of code for me. Any chance
    > >of getting this in the *next* version of PBasic??;-)
    > >Tom Fisher
    > >Dallas,TX

    Odd Bruce,

    your post came up with the > marks like it was part of the origional.

    I assume this is what you posted.


    IF NOT condition then branch_around
    GOSUB XXXXX
    Branch_around:



    Is this your wish list item ?



    Dave









    >
    >
    > >To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > >from the same email address that you subscribed. Text in the
    Subject and Body of the message will be ignored.
    > >
    > >Yahoo! Groups Links
    > >
    > >
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 18:08
    At 04:55 PM 4/25/04 +0000, Dave Mucha wrote:
    >--- In basicstamps@yahoogroups.com, Bruce Bates <bvbates@u...> wrote:
    >> At 11:24 AM 4/25/04 -0500, tboonefisher wrote:
    >> > As long as we're on the subject, it would be
    >> >REALLY nice if the IF statement could include
    >> >IF condition THEN GOSUB xxxxxx
    >> >Would simplify a lot of code for me. Any chance
    >> >of getting this in the *next* version of PBasic??;-)
    >> >Tom Fisher
    >> >Dallas,TX
    >
    >Odd Bruce,
    >
    >your post came up with the > marks like it was part of the origional.
    >I got lazy and didn't break the original, as I've done again here :-)
    >I assume this is what you posted.
    >
    >
    >IF NOT condition then branch_around
    >GOSUB XXXXX
    >Branch_around:
    >
    >
    >
    >Is this your wish list item ?

    No. it's one method to solve what you see as a deficiency. Jon claims there are
    other methods too, but my HELP feature doesn't work, so I can't check it out.
    I haven't used all that many features of PBASIC 2.5, but if Jon says it's there, I'm sure that it is.

    Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 19:02
    > IF NOT condition then branch_around
    > GOSUB XXXXX
    > Branch_around:
    >
    Yep, it is and is what I'm using BUT
    IF condition GOSUB subrout
    *looks* and reads much better!!<G>
    Tom Fisher
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 19:12
    > Really, gang, it's much easier than that -- and since telling the group
    > doesn't seem to do any convincing, let me PROVE it. Copy and paste this
    > demo into your BASIC Stamp editor:

    Well knock me over!! It does work....HOWEVER it
    isn't documented in Help.
    Thanks, Jon!!
    Tom Fisher
    Dallas,TX
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 19:27
    Your help feature doesn't work at all? Not heard that -- just
    occasional bobbles (opens under main window after it's been opened and
    closed in a given session) that we continue to investigate. In the very
    worst case, you could certainly create a desktop shortcut to the help
    file (I do this anyway, because I sometime want to look at the file
    without having the editor open). If you've download the latest Beta,
    the file you want is here:

    C:\Program Files\Parallax Inc\Stamp Editor v2.1 Beta 1\PBASIC.chm

    NOTE: You must have MS Explorer 4.0 or later installed in order to view
    this file.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Bruce Bates [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=sIWq1nkrFLexfOTCdWR1bVksGafmjBtypuF1ucjS2-rxSSqvQC3Lt1HystpLx-rzEUNvnhIWWI9VVK8Ml0HjhEU]bvbates@u...[/url
    Sent: Sunday, April 25, 2004 12:09 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item


    <snip>

    No. it's one method to solve what you see as a deficiency. Jon claims
    there are other methods too, but my HELP feature doesn't work, so I
    can't check it out. I haven't used all that many features of PBASIC 2.5,
    but if Jon says it's there, I'm sure that it is.

    Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 19:48
    Which help file are you reading? In the latest, you will find this
    syntax explanation on the IF-THEN-ELSE page:

    IF Condition THEN Statement(s) { ELSEIF Statement(s) } { ELSE
    Statement(s) }

    Since "GOSUB Some_Label" is a valid program statement (that is, it can
    stand alone), I maintain that it IS documented.

    Now, before somebody gets angry with me, the reason we didn't (perhaps)
    specifically document

    IF (condition) THEN GOSUB Label

    is that PBASIC has about 60 valid instructions that could follow THEN in
    that line of cde. Like this:

    IF (randValue.BIT0 = 1) THEN oddCount = oddCount + 1

    You see, it works the same way and fits within the syntax definition
    provided in the help file. I hope this helps.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: tboonefisher [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=rugKK3R_Csz6jwzlepShUxjCsnx1WLU6vovlZvP7I26wNn_b53tSuBh8V5M6gqy0oUeq6-6y-MRLK_NYx7_Plg0]tboonefisher@s...[/url
    Sent: Sunday, April 25, 2004 1:13 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item


    > Really, gang, it's much easier than that -- and since telling the
    > group doesn't seem to do any convincing, let me PROVE it. Copy and
    > paste this demo into your BASIC Stamp editor:

    Well knock me over!! It does work....HOWEVER it
    isn't documented in Help.
    Thanks, Jon!!
    Tom Fisher
    Dallas,TX
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 19:51
    At 11:27 AM 4/25/04 -0700, Jon Williams wrote:

    >Your help feature doesn't work at all? Not heard that -- just
    >occasional bobbles (opens under main window after it's been opened and
    >closed in a given session) that we continue to investigate.

    Last week it locked up my entire computer and I had to re=-boot as I mentioned
    to you last week. I had thought that was an initial use only problem, but that seems not to be the case, Now the HELP program, when invoked from the PBASIC Editor, locks up all by itself. That alone can be cancelled (CTL-ALT-DEL --> End Task) and operation can continue.

    >In the very worst case, you could certainly create a desktop shortcut to the help file (I do this anyway, because I sometime want to look at the file
    >without having the editor open). If you've download the latest Beta,
    >the file you want is here:
    >
    >C:\Program Files\Parallax Inc\Stamp Editor v2.1 Beta 1\PBASIC.chm

    That seems to work fine as a circumvention.


    >NOTE: You must have MS Explorer 4.0 or later installed in order to view
    >this file.
    >No problem there, I'm using MSE 6.02.8 . Thanks for the tip.
    >-- Jon Williams
    >-- Applications Engineer, Parallax
    >-- Dallas Office

    Bruce
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 20:03
    Please report any problems to pbasic25beta@p... so that they go
    to our Engineering staff. When you do send a problem report, be sure to
    include anything that may help:

    * processor type and speed
    * RAM
    * operating system and version
    * detail description of problem, and steps that can repeat it

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Bruce Bates [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=lQp7HtoC7yxS3ewVeJJcMa9Ac9pxIAZ25zvpJt6y5G_iTIUWQ2YwA1mKIGqexsR4kqbRWf0IRE5dmiyT]bvbates@u...[/url
    Sent: Sunday, April 25, 2004 1:52 PM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item


    At 11:27 AM 4/25/04 -0700, Jon Williams wrote:

    >Your help feature doesn't work at all? Not heard that -- just
    >occasional bobbles (opens under main window after it's been opened and
    >closed in a given session) that we continue to investigate.

    Last week it locked up my entire computer and I had to re=-boot as I
    mentioned
    to you last week. I had thought that was an initial use only problem,
    but that seems not to be the case, Now the HELP program, when invoked
    from the PBASIC Editor, locks up all by itself. That alone can be
    cancelled (CTL-ALT-DEL --> End Task) and operation can continue.

    >In the very worst case, you could certainly create a desktop shortcut
    >to the help file (I do this anyway, because I sometime want to look at

    >the file without having the editor open). If you've download the
    >latest Beta, the file you want is here:
    >
    >C:\Program Files\Parallax Inc\Stamp Editor v2.1 Beta 1\PBASIC.chm

    That seems to work fine as a circumvention.


    >NOTE: You must have MS Explorer 4.0 or later installed in order to view

    >this file. No problem there, I'm using MSE 6.02.8 . Thanks for the tip.
    >-- Jon Williams
    >-- Applications Engineer, Parallax
    >-- Dallas Office

    Bruce



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 20:04
    > > Really, gang, it's much easier than that -- and since telling the group
    >> doesn't seem to do any convincing, let me PROVE it. Copy and paste this
    >> demo into your BASIC Stamp editor:
    >
    > Well knock me over!! It does work....HOWEVER it
    >isn't documented in Help.
    >Thanks, Jon!!
    >Tom Fisher
    >Dallas,TX


    Hi Tom,

    Are you sure you have the latest help file? I can't check right now,
    but I'm pretty sure that the help file is the most up to date source
    of info about PBASIC.

    You should also be aware--PBASIC 2.5 has a lot more features you
    might like to take advantage of. For example, it used to be only
    IF conditions THEN label
    In PBASIC 2.5 you can now also do:

    IF conditions THEN statements ELSE statements

    IF conditions THEN
    statements
    ELSEIF
    statements
    ELSEIF
    statements
    ELSE
    statements
    ENDIF

    IF conditions THEN GOSUB xxx

    ON index GOSUB xxx,yyy,zzz

    and many more. The magic happens in the complier (STAMPW.EXE v. 2.0
    beta 1, which implements PBASIC 2.5). It works on all BASIC Stamps,
    old and new.

    I have my own little write-up on it, how the compiler translates the
    new PBASIC 2.5 back to the old PBASIC. The compiler hides all the
    messy details from the programmer.
    <http://www.emesystems.com/BS2pbasic25.htm>

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 20:05
    It *is* documented under IF-THEN-ELSE
    BUT *not* under IF-THEN:
    "IF Condition THEN Address"
    Looks like I found an omission...
    Do I get a *free* Stamp for this??<VBG>
    Tom Fisher
    Dallas,TX


    Original Message
    From: "Jon Williams" <jwilliams@p...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, April 25, 2004 1:48 PM
    Subject: RE: [noparse][[/noparse]basicstamps] PBasic Wishlist Item


    > Which help file are you reading? In the latest, you will find this
    > syntax explanation on the IF-THEN-ELSE page:
    >
    > IF Condition THEN Statement(s) { ELSEIF Statement(s) } { ELSE
    > Statement(s) }
    >
    > Since "GOSUB Some_Label" is a valid program statement (that is, it can
    > stand alone), I maintain that it IS documented.
    >
    > Now, before somebody gets angry with me, the reason we didn't (perhaps)
    > specifically document
    >
    > IF (condition) THEN GOSUB Label
    >
    > is that PBASIC has about 60 valid instructions that could follow THEN in
    > that line of cde. Like this:
    >
    > IF (randValue.BIT0 = 1) THEN oddCount = oddCount + 1
    >
    > You see, it works the same way and fits within the syntax definition
    > provided in the help file. I hope this helps.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: tboonefisher [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=AUROX3STbtKGE-AxI8ItRgnl3kbMAr5MNKDkWnt4ZOVU6jDWBUNsEvBsCGEVO4IcDz7EfHS2ZJxPiIO81ZGVhIc2]tboonefisher@s...[/url
    > Sent: Sunday, April 25, 2004 1:13 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item
    >
    >
    > > Really, gang, it's much easier than that -- and since telling the
    > > group doesn't seem to do any convincing, let me PROVE it. Copy and
    > > paste this demo into your BASIC Stamp editor:
    >
    > Well knock me over!! It does work....HOWEVER it
    > isn't documented in Help.
    > Thanks, Jon!!
    > Tom Fisher
    > Dallas,TX
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 20:18
    No, you get a smack-on-the-head for not actually reading the Help file!
    <grin> And you get to pay my overtime for answering questions on a
    Sunday ... oh, shoot, I'm on salary and don't get overtime pay....

    All kidding aside, notice that IF-THEN works with any version of PBASIC,
    while IF-THEN-ELSE only works with the BS2 family and when PBASIC 2.5 is
    declared.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: tboonefisher [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=zi_A9dIFZWIuawTM97_II0QHeZe69JHhDqaNS4t903PXkuqMwRzBWZkbMCeSt-um_VY99xbUd9uutJvHRQ6i]tboonefisher@s...[/url
    Sent: Sunday, April 25, 2004 2:06 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item


    It *is* documented under IF-THEN-ELSE
    BUT *not* under IF-THEN:
    "IF Condition THEN Address"
    Looks like I found an omission...
    Do I get a *free* Stamp for this??<VBG>
    Tom Fisher
    Dallas,TX


    Original Message
    From: "Jon Williams" <jwilliams@p...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, April 25, 2004 1:48 PM
    Subject: RE: [noparse][[/noparse]basicstamps] PBasic Wishlist Item


    > Which help file are you reading? In the latest, you will find this
    > syntax explanation on the IF-THEN-ELSE page:
    >
    > IF Condition THEN Statement(s) { ELSEIF Statement(s) } { ELSE
    > Statement(s) }
    >
    > Since "GOSUB Some_Label" is a valid program statement (that is, it can

    > stand alone), I maintain that it IS documented.
    >
    > Now, before somebody gets angry with me, the reason we didn't
    > (perhaps) specifically document
    >
    > IF (condition) THEN GOSUB Label
    >
    > is that PBASIC has about 60 valid instructions that could follow THEN
    > in that line of cde. Like this:
    >
    > IF (randValue.BIT0 = 1) THEN oddCount = oddCount + 1
    >
    > You see, it works the same way and fits within the syntax definition
    > provided in the help file. I hope this helps.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: tboonefisher [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=zi_A9dIFZWIuawTM97_II0QHeZe69JHhDqaNS4t903PXkuqMwRzBWZkbMCeSt-um_VY99xbUd9uutJvHRQ6i]tboonefisher@s...[/url
    > Sent: Sunday, April 25, 2004 1:13 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item
    >
    >
    > > Really, gang, it's much easier than that -- and since telling the
    > > group doesn't seem to do any convincing, let me PROVE it. Copy and
    > > paste this demo into your BASIC Stamp editor:
    >
    > Well knock me over!! It does work....HOWEVER it
    > isn't documented in Help.
    > Thanks, Jon!!
    > Tom Fisher
    > Dallas,TX
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and
    Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 20:29
    > No, you get a smack-on-the-head for not actually reading the Help file!
    > <grin> And you get to pay my overtime for answering questions on a
    > Sunday ... oh, shoot, I'm on salary and don't get overtime pay....
    > All kidding aside, notice that IF-THEN works with any version of PBASIC,
    > while IF-THEN-ELSE only works with the BS2 family and when PBASIC 2.5 is
    > declared.
    >
    Thanks.....methinks you are 'tap dancing' a bit and I bet a cup 'o
    StarBucks
    there's a clarification in the next help version!!<VBSEG> Anywho.....my code
    looks much better now with your help!!
    Tom Fisher
    Dallas,TX
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 20:40
    Yeah, what ARE you doing answering questions
    on a Sunday, ANYWAY? Don't you EVER have time
    off?

    Seriously, all of us would like to thank you
    for your timely support. It is above and
    beyond normal service.

    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > No, you get a smack-on-the-head for not actually reading the Help
    file!
    > <grin> And you get to pay my overtime for answering questions on a
    > Sunday ... oh, shoot, I'm on salary and don't get overtime pay....
    >
    > All kidding aside, notice that IF-THEN works with any version of
    PBASIC,
    > while IF-THEN-ELSE only works with the BS2 family and when PBASIC
    2.5 is
    > declared.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: tboonefisher [noparse][[/noparse]mailto:tboonefisher@s...]
    > Sent: Sunday, April 25, 2004 2:06 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item
    >
    >
    > It *is* documented under IF-THEN-ELSE
    > BUT *not* under IF-THEN:
    > "IF Condition THEN Address"
    > Looks like I found an omission...
    > Do I get a *free* Stamp for this??<VBG>
    > Tom Fisher
    > Dallas,TX
    >
    >
    >
    Original Message
    > From: "Jon Williams" <jwilliams@p...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Sunday, April 25, 2004 1:48 PM
    > Subject: RE: [noparse][[/noparse]basicstamps] PBasic Wishlist Item
    >
    >
    > > Which help file are you reading? In the latest, you will find
    this
    > > syntax explanation on the IF-THEN-ELSE page:
    > >
    > > IF Condition THEN Statement(s) { ELSEIF Statement(s) } { ELSE
    > > Statement(s) }
    > >
    > > Since "GOSUB Some_Label" is a valid program statement (that is,
    it can
    >
    > > stand alone), I maintain that it IS documented.
    > >
    > > Now, before somebody gets angry with me, the reason we didn't
    > > (perhaps) specifically document
    > >
    > > IF (condition) THEN GOSUB Label
    > >
    > > is that PBASIC has about 60 valid instructions that could follow
    THEN
    > > in that line of cde. Like this:
    > >
    > > IF (randValue.BIT0 = 1) THEN oddCount = oddCount + 1
    > >
    > > You see, it works the same way and fits within the syntax
    definition
    > > provided in the help file. I hope this helps.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: tboonefisher [noparse][[/noparse]mailto:tboonefisher@s...]
    > > Sent: Sunday, April 25, 2004 1:13 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: Re: [noparse][[/noparse]basicstamps] PBasic Wishlist Item
    > >
    > >
    > > > Really, gang, it's much easier than that -- and since telling
    the
    > > > group doesn't seem to do any convincing, let me PROVE it. Copy
    and
    > > > paste this demo into your BASIC Stamp editor:
    > >
    > > Well knock me over!! It does work....HOWEVER it
    > > isn't documented in Help.
    > > Thanks, Jon!!
    > > Tom Fisher
    > > Dallas,TX
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    Subject
    > > and
    > Body of the message will be ignored.
    > >
    > > Yahoo! Groups Links
    > >
    > >
    > >
    > >
    > >
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    Subject
    > and Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >
    >
    > This message has been scanned by WebShield. Please report SPAM to
    > abuse@p...
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-25 21:36
    --- In basicstamps@yahoogroups.com, "tboonefisher"
    <tboonefisher@s...> wrote:
    > It *is* documented under IF-THEN-ELSE
    > BUT *not* under IF-THEN:
    > "IF Condition THEN Address"
    > Looks like I found an omission...
    > Do I get a *free* Stamp for this??<VBG>
    > Tom Fisher
    > Dallas,TX

    Yeah, is that a 37cent USA Flag stamp or the 37 cent Elvis Stamp ?

    Dave
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-26 06:13
    Jon's code equates to the following (i.e., generates tokens
    identical to):

    cntr VAR Nib

    Main:
    DEBUG HOME, DEC2 cntr
    IF (cntr.BIT0) = 1 THEN xxx
    GOTO yyy
    xxx:
    GOSUB Is_Odd
    yyy:
    DEBUG CLREOL, CR
    cntr = cntr + 1
    PAUSE 500
    GOTO Main

    Is_Odd:
    DEBUG " is odd"
    RETURN

    It works fine, but in this instance it shows how code space may not
    be artfully optimized by the new editor. Thankfully, thought and
    creativity are still in play in Stamp programming :-).

    Regards,

    Steve

    On 25 Apr 04 at 9:52, Jon Williams wrote:

    > Really, gang, it's much easier than that -- and since telling the
    > group doesn't seem to do any convincing, let me PROVE it. Copy and
    > paste this demo into your BASIC Stamp editor:
    >
    > ' {$STAMP BS2}
    > ' {$PBASIC 2.5}
    >
    > cntr VAR Nib
    >
    > Main:
    > DEBUG HOME, DEC2 cntr
    > IF (cntr.BIT0 = 1) THEN GOSUB Is_Odd
    > DEBUG CLREOL, CR
    > cntr = cntr + 1
    > PAUSE 500
    > GOTO Main
    >
    > Is_Odd:
    > DEBUG " is odd"
    > RETURN
    >
    >
    > -- Jon Williams
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-26 13:49
    Well, my office is at home, so there is no clock to punch in and out.
    Even if there was, I've been working with BASIC Stamp users for over 10
    years now (long before I was an employee), and helping others solve
    technical problems with BASIC Stamps is fun for me. And thank you for
    you kind note.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Allan Lane [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=90TCi64XVMNGlNM1NmL8bPswMIxr1p2-j3evRPf_6XyTcdyj2HgklHcc7fY4s8X7ZaypUuG4MpWxmhQ4uNgWQIjoUhA]allan.lane@h...[/url
    Sent: Sunday, April 25, 2004 2:41 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item


    Yeah, what ARE you doing answering questions
    on a Sunday, ANYWAY? Don't you EVER have time
    off?

    Seriously, all of us would like to thank you
    for your timely support. It is above and
    beyond normal service.
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-26 16:36
    Hello (again) from Gregg C Levine
    I agree. Thank you for your efforts. And that's my arrangement for
    running an office, as well.
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi

    >
    Original Message
    > From: Jon Williams [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=6rjWx6klS_afIMaLCvnRQvI23_i4w_iLyH-JRWwG98KPdcTdaMReX_Imo5cHhAM7U7EXWa_AjqRE84UET_FWOwU]jwilliams@p...[/url
    > Sent: Monday, April 26, 2004 8:50 AM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item
    >
    > Well, my office is at home, so there is no clock to punch in and
    out.
    > Even if there was, I've been working with BASIC Stamp users for over
    10
    > years now (long before I was an employee), and helping others solve
    > technical problems with BASIC Stamps is fun for me. And thank you
    for
    > you kind note.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: Allan Lane [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=lNL1Hk_haSuULqWkoAzXkVNEhMC7jFpDOBKDCYj8RgYiAUkZHbYs8JWeKdLbsKjrQ3uqen1iFSGUDaXL4eyG4dAP2fE]allan.lane@h...[/url
    > Sent: Sunday, April 25, 2004 2:41 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item
    >
    >
    > Yeah, what ARE you doing answering questions
    > on a Sunday, ANYWAY? Don't you EVER have time
    > off?
    >
    > Seriously, all of us would like to thank you
    > for your timely support. It is above and
    > beyond normal service.
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-26 17:21
    I am in the same boat. I find that when someone else asks a
    question, I need to look at the problem from a different angle and
    often I realize something I didn't know. Seems their questions help
    me learn as well.

    But, I think most of us do appreciate your seeminly endless high
    quality support Jon. Very Well Done !

    Dave






    --- In basicstamps@yahoogroups.com, "Gregg C Levine"
    <hansolofalcon@w...> wrote:
    > Hello (again) from Gregg C Levine
    > I agree. Thank you for your efforts. And that's my arrangement for
    > running an office, as well.
    >
    > Gregg C Levine hansolofalcon@w...
    >
    > "The Force will be with you...Always." Obi-Wan Kenobi
    > "Use the Force, Luke."· Obi-Wan Kenobi
    >
    > >
    Original Message
    > > From: Jon Williams [noparse][[/noparse]mailto:jwilliams@p...]
    > > Sent: Monday, April 26, 2004 8:50 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item
    > >
    > > Well, my office is at home, so there is no clock to punch in and
    > out.
    > > Even if there was, I've been working with BASIC Stamp users for
    over
    > 10
    > > years now (long before I was an employee), and helping others
    solve
    > > technical problems with BASIC Stamps is fun for me. And thank
    you
    > for
    > > you kind note.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    Original Message
    > > From: Allan Lane [noparse][[/noparse]mailto:allan.lane@h...]
    > > Sent: Sunday, April 25, 2004 2:41 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] Re: PBasic Wishlist Item
    > >
    > >
    > > Yeah, what ARE you doing answering questions
    > > on a Sunday, ANYWAY? Don't you EVER have time
    > > off?
    > >
    > > Seriously, all of us would like to thank you
    > > for your timely support. It is above and
    > > beyond normal service.
Sign In or Register to comment.