This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

No vars reset :(

Old posts that have not been replied to for several years.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

And I have told you the solution in allmost every post since the problem was discovered.

I knew all along, what you where trying to discribe. You, howver, have failed to even look at any of the posts I have sent for a solution.

As stated, we will help people along the way, but we will not tell them exactly how to fix it. Not when it is blindingly obvious how to fix it.

Lets make things a little more simple.

1:

Code: Select all

set var "test <CODE>"
regsub -all -- "<CODE>" $var "test" var
2:

Code: Select all

set var "test"
regsub -all -- "<CODE>" $var "test" test
Version 1 is the equivilant of your regsub code. The value of $var will remain at the update value of "test test" thorugh the remainder of the script. You cna't tell later on, that the value of $var was originaly "test <CODE>".

Aplying this to you script

Code: Select all

set var "http://<IP>/channel"
regsub -all -- "<IP>" $var "192.168.254.1" var
At the end of this script, $var is set to "http://192.168.254.1/channel". Thus, if the IP changes, and we need to update any output made by the regsub, it can't be done, because <IP> is now missing.


Version 2 however, does not change the avlue of $var, thus, the substitution can take place many times, dynamicaly updating the output.

Apply this theory to both your script, and the mini script's above, and you will see, that the substiture can be made many times.

NOTE: This thread is becoming a severe waste of time. While all scripters lives begin as a newcomer, with very little knowledge. They usualy attempt to read things through, and/or try things themselves.

As this thread has become pathetic (due tot he fact, the answer has been repeated time and time again, refrased in allmost everyway possible), it will be locked next time anything is posted to it.
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Post by ProXy »

Ah, I got it know - THX a lot :)
Locked