Computer Science Canada

constants

Author:  y1234yy [ Sun Mar 15, 2009 1:14 pm ]
Post subject:  constants

Hi

I am having some trouble with constants. Do the values of constants have to be number or can it also be a string?

I am trying to output this, but turing said that "Hi" is not declared.

const x := Hi
put x

Am I using the const function wrong?

Author:  Tony [ Sun Mar 15, 2009 1:20 pm ]
Post subject:  RE:constants

I think you are looking for
Turing:

const x : string := "Hi"
put x

Author:  y1234yy [ Sun Mar 15, 2009 1:23 pm ]
Post subject:  Re: constants

oh right, you need the quotations

Thanks for remind me Very Happy


: