Computer Science Canada Reassinging Constant Statements... |
Author: | sensfan [ Fri Dec 09, 2005 11:54 am ] |
Post subject: | Reassinging Constant Statements... |
I really dont know how to word this so bear with me: Basically I want to reassign the following statement: locatexy (271,220) const message:="...Loading..." for i:1..length (message) colour (yellow) put message (i) .. end for To say "Game Loaded" at the same location. if timee > (3000) then locatexy (271,220) const mes:="Game Loaded" for i:1..length (mes) colour (yellow) put mes (i) .. end for end if Can you delete the text from the first constant and replace it with the new text at the same location? Does anyone know what I'm trying to do? |
Author: | MysticVegeta [ Fri Dec 09, 2005 12:04 pm ] |
Post subject: | |
hmm. why not use vars? |
Author: | do_pete [ Fri Dec 09, 2005 12:50 pm ] |
Post subject: | |
The whole point of constants is that they remain constant so you can't change the value |
Author: | Tony [ Fri Dec 09, 2005 12:50 pm ] | ||
Post subject: | |||
well a much better question would be:
How do you know that your game has loaded in precisely 3 seconds? Otherwise you could locate your constant in your memory, and overwrite the binary data at that location. Though variables are indeed much simpler (and safer) to use. |
Author: | codemage [ Fri Dec 09, 2005 1:19 pm ] |
Post subject: | |
I've never quite understood the compulsion that drives early CompSci students to make the user wait for loading screens that don't actually load anything. |
Author: | sensfan [ Fri Dec 09, 2005 1:38 pm ] |
Post subject: | |
I didn't even intend to make a loading screen. And indeed it doesn't actually load anything. I was just playing around - but I figured I might as well see if I can't get it to do something. |
Author: | md [ Fri Dec 09, 2005 1:41 pm ] | ||
Post subject: | |||
Tony wrote: well a much better question would be:
How do you know that your game has loaded in precisely 3 seconds? Otherwise you could locate your constant in your memory, and overwrite the binary data at that location. Though variables are indeed much simpler (and safer) to use. That assumes that the constant is actually stored. When it's a constant it's easiest to just optimize it out of memory entirely ![]() |
Author: | Tony [ Fri Dec 09, 2005 3:26 pm ] |
Post subject: | |
Turing stores constants in memory. Memory location can be writen over. |