
-----------------------------------
sensfan
Fri Dec 09, 2005 11:54 am

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?

-----------------------------------
MysticVegeta
Fri Dec 09, 2005 12:04 pm


-----------------------------------
hmm. why not use vars?

-----------------------------------
do_pete
Fri Dec 09, 2005 12:50 pm


-----------------------------------
The whole point of constants is that they remain constant so you can't change the value

-----------------------------------
Tony
Fri Dec 09, 2005 12:50 pm


-----------------------------------
well a much better question would be:

 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.

-----------------------------------
codemage
Fri Dec 09, 2005 1:19 pm


-----------------------------------
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
Fri Dec 09, 2005 1:38 pm


-----------------------------------
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
Fri Dec 09, 2005 1:41 pm


-----------------------------------
well a much better question would be:

 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
Fri Dec 09, 2005 3:26 pm


-----------------------------------
Turing stores constants in memory. Memory location can be writen over.
