Welcome to Pauls PureProject
 Home Online Reference Guide duplicated from http://cvs.purebasic.com  
 Online Resources
   · Reference

 Libraries
     2DDrawing
     Billboard
     Camera
     CDAudio
     Cipher
     Clipboard
     Console
     Database
     Date
     Desktop
     Engine3D
     Entity
     File
     FileSystem
     Font
     Gadget
     Help
     Image
     ImagePlugin
     Joystick
     Keyboard
     Library
     Light
     LinkedList
     Material
     Math
     Memory
     Menu
     Mesh
     Misc
     Module
     Mouse
     Movie
     Network
     OnError
     Packer
     Palette
     Particle
     Preference
     Printer
     Requester
     Sort
     Sound
     SoundPlugin
     Sprite
     Sprite3D
     StatusBar
     String
     SysTray
     Terrain
     Texture
     Thread
     Toolbar
     Window

 Gosub : Return


Syntax
Gosub MyLabel 
   
yLabel: 
 ...
Return

Description
Gosub stands for 'Go to sub routine'. A label has to be specified after Gosub then the program will continue at the label position until it encounters a Return. When a return is reached, the program is transferred below the Gosub. Gosub is very useful when building fast structured code.

Example:

  a = 1
  b = 2
  Gosub ComplexOperation 
  PrintNumberN(a) 
  End 
       
  ComplexOperation: 
    a = b*2+a*3+(a+b) 
    a = a+a*a 
  Return 

Syntax
FakeReturn 
Description
When you want to jump from a sub routine (with the command Goto) to another part in the code outside of this sub routine, you need to use a FakeReturn which simulate a return without do it really. If you don't use it, your program will crash. This function should be useless because a well constructed program don't use Goto. But sometimes, for speed reason, it could help a bit.

Example:

  Gosub SubRoutine1
     
  SubRoutine1:
    ...
    If a = 10
      FakeReturn 
      Goto Main_Loop 
    EndIf 
  Return



Hosted by Reel Media Productions Copyright©2001-2004 All Rights Reserved