|
|
Avenue language | |   |
Avenue code is made of instructions associated in a script, and of comments. An instruction may group standard or personnal functions or scripts, variables, datas (strings, numbers, ...), and expressions. Comments It's an absolute necessity to add comments to Avenue code, at least to read it again after months ... Comments begin by ' and end at the end of the line, like this: 'After the tenth revision, a well-commented code is always better ! '--- And a comment may be embedded like this one ... Instructions Avenue instructions are like: aText = "Hello!" myVariable = 2 + 2 Scripts Instructions are grouped in a script. A script own its local variables, and may send or receive parameters: '--- Attached to an ArcView button (property click), this script enable '--- the button if 2 thèmes are selected, or disable it if not. theView = av.GetActiveDoc '<- the variable theView is local. SELF.SetEnabled((2 = theView.GetActiveThemes.Count)) '<- SELF represent here the button which this script is attached to.
| |   |
|