WITH ... ENDWITH

Previous  Next

 

WITH namespace

   statements

ENDWITH

 


 

Make specified Namespace the active (default) namespace.  When a Namespace is active you can omit the Namespace in the function name.  The Namespace can be a STRING variable making it possible to set the active Namespace in run-time.

 

Example:

 

$LIBRARY "MyBASIC2_ExtLib"

 

DIM filename AS STRING

DIM fileno AS INTEGER

 

PRINT "_FileName: ";

INPUT filename

 

WITH file

  fileno = .Create( filename )

 

  IF fileno <> -1 THEN

     .Puts( fileno, "Hello World !\n" )

     .Puts( fileno, "\n" )

     .Puts( fileno, "End Of File\n" )

     .Close( fileno )

  ENDIF

ENDWITH