define a constant in a virtual class

A

Andrew

How is it possible to define a constant in a virtual class?

E.g. I wrote the following code

tml = {
sayHello : function()
{
alert('hello');
}
}

now if I want to add a constant into tml virtual class, what I need to
do?

I tried something like

tml = {
const1 : Integer = 0,
sayHello : function()

or

tml = {
const1 : function(){return 0;},
sayHello : function()


in both case, trying to get - inside tml object - the value of
const1 ... it results in a Object value and not the Integer value I
need.
Where am I doing mistakes?

Thanks
Andrea
 
R

Randy Webb

Andrew said the following on 6/8/2007 6:02 PM:
How is it possible to define a constant in a virtual class?

Javascript has no concept of what a "constant" is. What is it that you need?
Where am I doing mistakes?

const1: 0;
 
A

Andrew

Well what I need is to a have a variable that store a value that can
be matched with another value.

According to my sample above.

tml = {
sayHello : function()
{
alert('hello');
} ,
myvalue = 0,
sayHello2 : function()
{alert (tml.myvalue)}
}
 
R

Randy Webb

Andrew said the following on 6/9/2007 4:52 AM:
Well what I need is
<snip>

What you "need" is to quote what you are replying to so people know what
it is that you are replying to/about. You might be surprised to know how
many people ignore people who top-post, don't quote, or don't trim. It
is brutal sometimes.
 
A

Andrew

What you "need" is to quote what you are replying

I suppose the overquoting is an activity that let waste people time
and space, especially when people don't run on 48'' screen. Scroll
down the mouse along the screen and cross the eye just because read
the previous reply it's too difficult.

Quoting should be - at my advice - done when multiple reply or more
argument has given not always.
So, I appreciate your suggestion, but I think that an interesting
reply was better that read how to post.

This is an abstract of netiquette ... "When replying to a message,
include enough original material to be understood but no more.
It
is extremely bad form to simply reply to a message by including
all the previous message: edit out all the irrelevant material."

And I think that a summarize in my case wasn't needed.

Bye
Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,160
Messages
2,570,890
Members
47,423
Latest member
henerygril

Latest Threads

Top