const in web app gives syntax error

I am beginning to make a web project. If in a method a put, for example:
Const PIPPO as text = “ciao”
i get syntax error.

What’s wrong? Maybe I put const command in wrong place? (now it’s inside a method)
And where have I to put “DIM” commands to have such variables shared everywhere in my application? (something as “dim shared” in old basic)

Thanks for hints

Do not specify the data type:

Const PIPPO = "ciao"

without data type it works, thanks. Where I should put constant definition in order ro use them in any method of the project?
Thanks

Modules are commonly used to store global constants.

What version of Xojo are you using? ‘Const PIPPO as text = “ciao”’ works for me.

if was old 2014 1.1 version, I am just downloading the newest trial version and I will try with the new xojo version; thanks

Yeah, strongly typed constants were added after that release.

Thanks… about modules: can I write code (for example CONST or DIM commands) in a module, or in module I can only define constants and variable in xojo interface?
(I have already ready about one page of DIM commands, it’s easier to cut and past in module’s code all together, to have variables shared inspite of setting one by one in xojo graphical interface under module)
Thanks

Module-level constants can only be added using the UI.

http://developer.xojo.com/userguide/modules