Page 1 of 1
More structered blocks for Structural or Modular programming
Posted: Sun May 04, 2003 10:22 pm
by idStefke
Dear Support,
I would like to see more structured blocks like in other BASIC's
' In the main module:
Procedure Main()
End Procedure
Function <function_name> (parameters....) as <return_type>
End Function
IF ... THEN ...ELSE...END IF Blocks
SELECT...CASE...END SELECT
DO...LOOP [UNTIL | WHILE] and DO [WHILE | UNTIL]...LOOP
- Module files
- Project files
Kind regards
Posted: Sun May 04, 2003 11:13 pm
by Andre
Function <function_name> (parameters....) as <return_type>
End Function
IF ... THEN ...ELSE...END IF Blocks
SELECT...CASE...END SELECT
DO...LOOP [UNTIL | WHILE] and DO [WHILE | UNTIL]...LOOP
Have you ever seen a PureBasic code or the manual
There is:
If ... Else ... ElseIf ... EndIf (there will be no Then

)
Select .... Case ... EndSelect
While .... Wend
Repeat ... Until
Re: More structered blocks for Structural or Modular program
Posted: Mon May 05, 2003 10:33 am
by tinman
idStefke wrote:' In the main module:
Procedure Main()
End Procedure
Function <function_name> (parameters....) as <return_type>
End Function
You can do this if you really want (procedures are the same as functions):
Declare my_function(parameter)
Procedure Main()
my_function(666)
EndProcedure
Procedure my_function(parameter)
; Do whatever
EndProcedure
Main() ; Call main procedure and run program
idStefke wrote:
- Module files
- Project files
Module files? Well, you can create any other source files and include it in your code with the XIncludeFile or IncludeFile keywords.
Project files? It might be worthwhile, but PureBasic sources are not a combination of many different file types at the moment. As I said above, you can split it into files and include them all.