| View previous topic :: View next topic |
| Author |
Message |
Moki
Joined: 23 Feb 2008 Posts: 96 Location: North Carolina
|
Posted: Wed Jul 23, 2008 1:19 pm Post subject: Completely deleting a variable? |
|
|
I need to delete a variable (not set it to 0) Completely delete it so that it may use it again later in the script. How would I do this.
Thank you in advance  _________________ http://www.mofiki.com |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 290 Location: Canada
|
Posted: Wed Jul 23, 2008 1:21 pm Post subject: |
|
|
what do you mean... like you want somehting like this???
| Code: |
vfish = 10
delete vfish ; ???
vfish = 90
|
Because you can't do that... do somethign like this.
| Code: |
vfish = 10
vfish2 = 90
|
you can have alot more than 1 varriable. One of my script has about 85 varriables that read off a file. _________________ http://www.spider-games77.piczo.com
Join the Elite few... |
|
| Back to top |
|
 |
HugoV
Joined: 27 May 2007 Posts: 499
|
Posted: Wed Jul 23, 2008 1:22 pm Post subject: |
|
|
| What is wrong with this will empty the variable |
|
| Back to top |
|
 |
Moki
Joined: 23 Feb 2008 Posts: 96 Location: North Carolina
|
Posted: Wed Jul 23, 2008 1:26 pm Post subject: |
|
|
| Code: | nextpoint:
Gui +AlwaysOnTop -Caption +ToolWindow
Gui, -Caption +ToolWindow -SysMenu +AlwaysOnTop
Gui, Font, s8
Gui, Add, Text, x10 y3 w200 h15, %energypoints% - Energy
Gui, Add, Progress, x10 y18 w200 h10 vProgress, 0
y := A_ScreenHeight - 60
x := A_ScreenWidth - 220
Gui, Show, NoActivate y%y% x%x% h30
Loop, 5
{
Progress += (100 / 5)
GuiControl,, Progress, %Progress%
Sleep, 1000
}
energypoints := (%energypoints% + 1)
Gosub, nextpoint
ExitApp |
This is the code when it starts again it crashes because the progress variable cannot be used again. Any ideas other than deleting the variable? _________________ http://www.mofiki.com |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 370 Location: canada
|
Posted: Wed Jul 23, 2008 1:27 pm Post subject: |
|
|
As per help file.
| Quote: | | The memory occupied by a large variable can be freed by setting it equal to nothing, e.g. var := "" |
You dont have to "delete" the variable.
var := 10
var := "asdf"
You can change it anytime. _________________ -=Raz=- |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 370 Location: canada
|
Posted: Wed Jul 23, 2008 1:31 pm Post subject: |
|
|
Oh.. use
at the start
its one way around that.
| Code: | nextpoint:
gui destroy
Gui +AlwaysOnTop -Caption +ToolWindow
Gui, -Caption +ToolWindow -SysMenu +AlwaysOnTop
Gui, Font, s8
Gui, Add, Text, x10 y3 w200 h15, %energypoints% - Energy
Gui, Add, Progress, x10 y18 w200 h10 vProgress, 0
y := A_ScreenHeight - 60
x := A_ScreenWidth - 220
Gui, Show, NoActivate y%y% x%x% h30
Loop, 5
{
Progress += (100 / 5)
GuiControl,, Progress, %Progress%
Sleep, 1000
}
energypoints := (%energypoints% + 1)
Gosub, nextpoint
ExitApp |
Your more then likely missing a return in your code as well.
right now your code just does a never ending recursive loop. _________________ -=Raz=-
Last edited by Razlin on Wed Jul 23, 2008 1:35 pm; edited 1 time in total |
|
| Back to top |
|
 |
Moki
Joined: 23 Feb 2008 Posts: 96 Location: North Carolina
|
Posted: Wed Jul 23, 2008 1:34 pm Post subject: |
|
|
ok thank you very much ... I was trying to think of a way to describe it better lol. nobody was understanding the question but you hit the nail on the head.
Thank you very much  _________________ http://www.mofiki.com |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 370 Location: canada
|
Posted: Wed Jul 23, 2008 1:36 pm Post subject: |
|
|
Your welcome. _________________ -=Raz=- |
|
| Back to top |
|
 |
|