Author Topic: What is dedicated-compatible?  (Read 2241 times)

==> $var1 = getRandom(10);
==> echo($var1);
7
==> $var2 = getRandom(10);
==> echo($var2);
4
==> deleteVariables("$var*");
==> echo($var1);

==> echo($var2);

==> quit

You figure it out.

==> deleteVariables("$var*");
==> echo($var1);
==> echo($var2);
i know what your saying, but can i make it so that it can delete only 1 variable thats a integer? (idk what its really called) as in, WITHOUT a wildcard? example:
$var[1] = "a";
$var[2] = "b";
$var[21] = "c";
deleteVariables("$var[2]");

i know what your saying, but can i make it so that it can delete only 1 variable thats a integer? (idk what its really called) as in, WITHOUT a wildcard? example:
$var[1] = "a";
$var[2] = "b";
$var[21] = "c";
deleteVariables("$var[2]");
That should work fine.  Test it and see what happens.

however........ I dont think you can do something like this:
Code: [Select]
%a=2;
deleteVariables("$var[%a]");


But this will work fine
Code: [Select]
$var[2]=0;
%a=21;
$var[%a]=0;

function testin()
{
   $var[1] = "a";
   $var[2] = "b";
   $var[21] = "c";
   echo($var[1]);
   echo($var[2]);
   echo($var[21]);
   deleteVariables("$var[2]");
   echo($var[1]);
   echo($var[2]);
   echo($var[21]);
}

returns:
a
b
c
a
b
c

nothing happened.
i tryed adding the wildcard, and it seems it doesent work with the [ and ]'s.

try this and see what you get:
function testin()
{
   $var[1] = "a";
   $var[2] = "b";
   $var[21] = "c";
   echo($var[1]);
   echo($var[2]);
   echo($var[21]);
   deleteVariables("$var2*");
   echo($var[1]);
   echo($var[2]);
   echo($var[21]);
}

im gettin:
a
b
c
a
b
(blank line)

this was not what the target to have was. what i was hoping for was this:
a
b
c
a
c
« Last Edit: April 27, 2011, 06:51:55 PM by Ipquarx »

however........ I dont think you can do something like this:
Code: [Select]
%a=2;
deleteVariables("$var[%a]");
deleteVariables("$var" @ %a);