• What is a DBREF ?
    Why, how and what do we use them for ?
    Cheers
    Neil
  • Some examples: (Sorry, it is too late now for a desccription :-))

    !dbref = /PLANT
    !string = '/PLANT'

    !pos = !dbref.pos
    !pos = !string.dbref().pos

    !string = !dbref.name
    !dbref = !string.dbref()
  • [QUOTE=NEILD;8808]What is a DBREF ?
    Why, how and what do we use them for ?
    Cheers
    Neil

    Basically the DBREF is an inbuilt object of the system which equates to a database element. Which allows you to assign a PML2 variable to a database element and use it in a similar way to other PML2 variables.

    This means you can access any of the elements attributes (including pseudo) using the dot notation method as shown in the previour reply, e.g.

     !type  = !!ce.type
     !fullType = !!ce.fulltype

    Besides accessing the attributes it can be used to set an element attributes without actually navigating to it, e.g.

     !element = !!ce
     -- Navigate somewhere else
     /*

     -- Change name of element
     !element.name = '/NewName'

    Note that when assigning the value it must be of the correct data type, however, you might find that not all attributes can be set this way at the moment, but it handles most.

    The "!!CE" global variable used above is a system maintained DBREF variable which reflects the current database element you are at.

    Hope this helps, Neil