if i=1 then b=5

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

:) , or:

If a > 1 ;Then
DoIt()
Else
DoNothing()
Endif

I don't request a 'then', it was getting on my nerves already in QBasic and I was delighted not to have to use it in PB. But I don't care if it would be optional, so I'm not against it :wink:
%1>>1+1*1/1-1!1|1&1<<$1=1
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Froggerprogger,

You made me laugh with ;

I did not thought it was also part of PB language ... but you are right somewhere.

lol
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

If you add a Then, please also add a Goto and GoSub/Call

GoTo:

Good old QuickBasic:

Code: Select all

If a=2 GoTo GoToMark
That:

Code: Select all

[claculate the Condition]
[If True jump to GoToMark]
...
GoToMark:
[TheCode]
...
would just be a bit quicker(and smaller) as:

Code: Select all

[claculate the Condition]
[If True jump to IfCode]
[jump to EndOfIfCode] ; only executed, if False
IfCode:
[jump to GoToMark]
EndOfIfCode:
...
GoToMark:
[TheCode]
...
And the GoSub(can also be named Call for use with Procedures) at the same way.

I hope at least Fred or Fr34k has understood me!(sorry for my bad English!)
If not I can explain it again in German(As far as I know Fr34k speaks German. If not, please correct me!)
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

i dont know why but for some reason i hate the 'then' keyword! it just looks to basic'y to me.
--Kale

Image
Post Reply