• Description:
    WITH keyword introduces the namespaces support. If You have a part of code, where You use very often some deep variable pointers (eg.: a.b.c.d), You would probably like to be able to leave it. You can make it simply by preprocessor, but it's not very clear solution. Better, and for this purpose made solution is the namespaces support, where You define a variable, which You don't wish to enter in the source and then use only items, that are contained in the variable's object.

    But to use it correctly, be sure, that item/variable names won't collide! Else if there is a variable and an item with same names, the variable is taken! If You define one WITH inside another WITH, the inside one has higher priority and will be taken before the 'parent' one. If You define multiple variables (WITH a,b,c) the first one is taken first.

    You can use simple (a) and complex (a.b[x].c) variables.

  • Syntax:
    
      WITH <variable1,variable2,...>
    
        code, where the variable should be automaticaly inserted.
    
      ENDWITH
    
    


  • Example:
    
      OBJECT obj
    
        name,age,sex
    
    
    
      PROC main()
    
        DEF person:PTR TO obj
    
    
    
        WITH person
    
          name:='MarK'
    
          age:=24
    
          sex:="M"
    
        ENDWITH
    
    
    
      ENDPROC
    
    

    this does exactly the same as:
    
      OBJECT obj
    
        name,age,sex
    
    
    
      PROC main()
    
        DEF person:PTR TO obj
    
    
    
        person.name:='MarK'
    
        person.age:=24
    
        person.sex:="M"
    
    
    
      ENDPROC