More structered blocks for Structural or Modular programming

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
idStefke
User
User
Posts: 25
Joined: Sun May 04, 2003 10:01 pm
Location: BELGIUM

More structered blocks for Structural or Modular programming

Post 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
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post 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 :lol:)
Select .... Case ... EndSelect
While .... Wend
Repeat ... Until
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: More structered blocks for Structural or Modular program

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply