Page 1 of 1

Posted: Mon Jan 07, 2002 10:22 pm
by BackupUser
Restored from previous forum. Originally posted by blue-speed.

hi!

why i can put the procedure only before ive activate it like this:

Code: Select all

Procedure.l Maximum(nb1.l, nb2.l)
  If nb1>nb2
    Result.l = nb1
  Else
    Result = nb2
  Endif

  ProcedureReturn Result
EndProcedure 

Result.l = Maximum(15,30)
PrintNumberN(Result)
End  
this code doesent work

Code: Select all

Result.l = Maximum(15,30)
PrintNumberN(Result)
End  

Procedure.l Maximum(nb1.l, nb2.l)
  If nb1>nb2
    Result.l = nb1
  Else
    Result = nb2
  Endif

  ProcedureReturn Result
EndProcedure 
the code would look cleaner when u can put it like the second one, so i dont have tu use the dirty labels

cu
bluespeed

WOOOOOOW!

Edited by - blue-speed on 07 January 2002 22:23:45

Posted: Mon Jan 07, 2002 10:34 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.

Suppose it's because Purebasic is not a object oriented language like C++, Ruby, Python or ...



Have a nice day...
Franco

Posted: Mon Jan 07, 2002 10:43 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

Simply because PureBasic do a one pass compile. From to top to bottom.

Fred - AlphaSND

Posted: Mon Jan 07, 2002 11:23 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

All procedures must be declared before you can use them, that's all.


PB - Registered PureBasic Coder