Page 2 of 4

Posted: Tue Mar 21, 2006 1:36 pm
by Dare2
Everything you say is true.

However, the reasons for being a caveman may differ.

My fingers type THEN, my subconscious has been patterned. My mind is six lines ahead (probably chanting a mantra .. This is Pure, EndIf not End If) .. Press F5. Error. ARGHHHHHHHH! Thump. Shatter.

Go to bed as without a screen, coding is not possible. :)

So in my case, my THEN. :)

Posted: Tue Mar 21, 2006 1:40 pm
by PB
BTW, I just found two of the old requests for If/Then:

http://www.purebasic.fr/english/viewtopic.php?t=11329
http://www.purebasic.fr/english/viewtopic.php?t=6310

So, hopefully those who asked for it, can enjoy my macro (and expand it). :)

Posted: Tue Mar 21, 2006 1:48 pm
by Dare2
Hehe. The tribe grows. Ooga Ooga.

Another thing that seems pointless is Select Case.

Why case? Is it just there to trip you up when you switch back to PureBasic? What else can you select? Box? Trunk? BackPack? Container? HandBag?

What deep and meaningful purpose does case have there?

Unfortunately, no macro. Unless ..

Code: Select all

Macro Case
  MacroIf MacroPreceedingWord = "Select"
    MacroIGNORE
  MacroElse
    Case
  MacroEndIf
EndMacro
Reckon I might put this feature into the wishlist!



Then again, maybe not.

Posted: Tue Mar 21, 2006 4:14 pm
by Trond
thefool wrote:
Trond wrote:I've never seen that use of then. Where does that interpretation of what then should do come from?
:shock:

How can you even ask..
Because:
Pascal uses then, and it does not equal this macro version.
Rapid-Q (which is a basic) uses then, and it does not equal this macro version.
VB (which is a basic) uses then, and it does not equal this macro version. Although VB's implementation of then is more similar to this macro version than Pascal's and Rapid-Q's implementation of then, VB's then does not equal this macro version.
FreeBASIC (which is a basic) uses then, and it does not equal this macro version.
Modula-2 uses then, and it does not equal this macro version.
BlitzBasic (which is a basic) uses then, and it does not equal this macro version.
Fortran uses then, and it does not equal this macro version.

Now tell me, where did you see an implementation of then which behaves similar to this macro? (Big prize if you can! (Copying and pasting this macro does not count!!))

Posted: Tue Mar 21, 2006 5:08 pm
by mike74
I like it, PB. Thanks!

Mike

Posted: Tue Mar 21, 2006 5:22 pm
by thefool
Wondering, except for the paranthesis why isnt this macro version equal to quickbasic and visual basic?

Posted: Tue Mar 21, 2006 6:34 pm
by Trond
thefool wrote:Wondering, except for the paranthesis why isnt this macro version equal to quickbasic and visual basic?
I never said anything about quickbasic.
It's not equal to any language because of the parenthesis.

It's not equal to VB because this is possible in VB and not with this macro version:

Code: Select all

If whatever Then dosomething Else dosomethingelse
Also you can use ElseIf after then in VB.

Posted: Tue Mar 21, 2006 10:15 pm
by thefool
Trond wrote:
thefool wrote:Wondering, except for the paranthesis why isnt this macro version equal to quickbasic and visual basic?
I never said anything about quickbasic.
It's not equal to any language because of the parenthesis.

It's not equal to VB because this is possible in VB and not with this macro version:

Code: Select all

If whatever Then dosomething Else dosomethingelse
Also you can use ElseIf after then in VB.
You can skip the else too...
Nevermind...
...


here you go:
Image

Posted: Tue Mar 21, 2006 11:49 pm
by PB
> It's not equal to any language because of the parenthesis

That's just nit-picking on PureBasic's macro limitations. :roll:

The functionality and concept is there. I based it on older Basics where Else
is not used. Let all those who replied with "thanks!" enjoy it, as it's obviously
serving their needs. I don't understand why it's being picked on so much.

Posted: Wed Mar 22, 2006 1:32 am
by Konne
I think in QBasic is the "then" equal to

Code: Select all

macro then
:
endmacro

Posted: Wed Mar 22, 2006 7:12 am
by PB
> Now tell me, where did you see an implementation of then which behaves
> similar to this macro? Big prize if you can!

Here's two implementations: VB and C64. Now, where's my prize? :twisted:

Code: Select all

Private Sub Command1_Click()
    Dim var As Byte
    var = 1
    If var = 1 Then Debug.Print "Yes, var=1"
End Sub
Image

Posted: Wed Mar 22, 2006 9:25 am
by blueznl
then is ugly then is bad then is the command we should never have had...
but then again, but here and now, then is then and pure is now
please stop thy then then thy will see
the beaty that if else endif will bring to thee!

got carried away, sorry

Posted: Wed Mar 22, 2006 9:51 am
by helpy
The sense of this discussion escapes me!

Posted: Wed Mar 22, 2006 10:18 am
by IceSoft
'THEN' will not improve PureBasic.

The only reason for using any new keywords should be the improvement of PureBasic.

Posted: Wed Mar 22, 2006 10:18 am
by Dare2
helpy wrote:The sense of this discussion escapes me!
Good thing - if you thought it made sense then you'd need professional help. :)