Posted: 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?
Sponsor Sponsor
MysticVegeta
Posted: Fri Dec 09, 2005 12:04 pm Post subject: (No subject)
hmm. why not use vars?
do_pete
Posted: Fri Dec 09, 2005 12:50 pm Post subject: (No subject)
The whole point of constants is that they remain constant so you can't change the value
Tony
Posted: Fri Dec 09, 2005 12:50 pm Post subject: (No subject)
well a much better question would be:
code:
if timee > (3000) then
locatexy (271,220)
const mes:="Game Loaded"
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.
Posted: Fri Dec 09, 2005 1:19 pm Post subject: (No 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.
sensfan
Posted: Fri Dec 09, 2005 1:38 pm Post subject: (No 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.
md
Posted: Fri Dec 09, 2005 1:41 pm Post subject: (No subject)
Tony wrote:
well a much better question would be:
code:
if timee > (3000) then
locatexy (271,220)
const mes:="Game Loaded"
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
Tony
Posted: Fri Dec 09, 2005 3:26 pm Post subject: (No subject)
Turing stores constants in memory. Memory location can be writen over.