| Blockland Forums > Modification Help |
| What is dedicated-compatible? |
| << < (4/5) > >> |
| Xalos:
==> $var1 = getRandom(10); ==> echo($var1); 7 ==> $var2 = getRandom(10); ==> echo($var2); 4 ==> deleteVariables("$var*"); ==> echo($var1); ==> echo($var2); ==> quit You figure it out. |
| Ipquarx:
--- Quote from: Xalos on April 27, 2011, 03:38:52 PM ---==> deleteVariables("$var*"); ==> echo($var1); ==> echo($var2); --- End quote --- 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]"); |
| Red_Guy:
--- Quote from: Ipquarx on April 27, 2011, 05:15:51 PM ---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]"); --- End quote --- That should work fine. Test it and see what happens. however........ I dont think you can do something like this: --- Code: ---%a=2; deleteVariables("$var[%a]"); --- End code --- But this will work fine --- Code: ---$var[2]=0; %a=21; $var[%a]=0; --- End code --- |
| Ipquarx:
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. |
| Red_Guy:
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]); } |
| Navigation |
| Message Index |
| Next page |
| Previous page |