If Then Question
Archiver
Posts: 46,084
Hi Guys,
I am used to useing a Bx-24 chip, but have to use a stamp for class
and so this is probably a simple question but I can't figure it out.
What I want is to have an If-Then statement that is the statement is
true it calls a subroutine, and then returns after the subroutine is
finished running. However, when I write
If Condition = True then Subroutine
Rest of code
it executes the subroutine but doesn't return. I even put the return
line in the subroutine. It does return if I use the Gosub comand,
but for an If-Then statement you don't use Gosub.
Is there a work around for this?
I am used to useing a Bx-24 chip, but have to use a stamp for class
and so this is probably a simple question but I can't figure it out.
What I want is to have an If-Then statement that is the statement is
true it calls a subroutine, and then returns after the subroutine is
finished running. However, when I write
If Condition = True then Subroutine
Rest of code
it executes the subroutine but doesn't return. I even put the return
line in the subroutine. It does return if I use the Gosub comand,
but for an If-Then statement you don't use Gosub.
Is there a work around for this?
Comments
this
if condition then dogosub
goto skipgosub
dogosub:
gosub label
skipgosub:
I know its messy but it should work...
Original Message
From: <radtke@h...>
To: <basicstamps@yahoogroups.com>
Sent: Friday, February 23, 2001 11:44 PM
Subject: [noparse][[/noparse]basicstamps] If Then Question
> Hi Guys,
>
> I am used to useing a Bx-24 chip, but have to use a stamp for class
> and so this is probably a simple question but I can't figure it out.
> What I want is to have an If-Then statement that is the statement is
> true it calls a subroutine, and then returns after the subroutine is
> finished running. However, when I write
>
> If Condition = True then Subroutine
> Rest of code
>
> it executes the subroutine but doesn't return. I even put the return
> line in the subroutine. It does return if I use the Gosub comand,
> but for an If-Then statement you don't use Gosub.
>
> Is there a work around for this?
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
radtke@hotmail.com writes:
and so this is probably a simple question but I can't figure it out.
What I want is to have an If-Then statement that is the statement is
true it calls a subroutine, and then returns after the subroutine is
finished running. ·However, when I write
If Condition = True then Subroutine
Rest of code
it executes the subroutine but doesn't return. ·I even put the return
line in the subroutine. ·It does return if I use the Gosub comand,
but for an If-Then statement you don't use Gosub.
PBASIC is designed for embedded apps (VB isn't...), so it's a little slimmer
than what you're used to. ·You can do it this way:
·IF NOT (condition) THEN Skip
·GOSUB YourSubNameHere
Skip:[/font]