
-----------------------------------
Naveg
Sat Mar 12, 2005 12:52 pm

* before identifier
-----------------------------------
I've seen a * used before an identifier before while reading other people's code. like...var *person:string. What does this do?

-----------------------------------
Delos
Sat Mar 12, 2005 4:15 pm


-----------------------------------
The * is the short form for "pervasive".  This means that the variable is...umm..universal, and needn't be imported into an modules or other such containers within a proggie.

Try it:


var superVar : string := "Muwahahaha"

module test

export main

proc main
put superVar
end main
end test

test.main



Try run that.  It crashes.  Now add a "*" infront of 'superVar'.  Run again.  Magic.
This becomes more useful when you need to programme things that get really complicated and require a large number of classes and modules and other such object-type thingies.

-----------------------------------
Naveg
Sat Mar 12, 2005 4:36 pm


-----------------------------------
that only happens if you export?

-----------------------------------
Delos
Sun Mar 13, 2005 12:42 am


-----------------------------------
Not the exporting part...add the line 

import superVar


to the beginning of the module and leave the variable as non-pervasive.  There you go...manual importation of req'd vars.  Once again, the uses may not seem apparent...
