//Returns the sValue of the item we have found public string GetTemporaryVariable(string sSession, string sItem) { //Loop through the variables ArrayList aVariables = GetTemporaryArray(sSession); for (int i = 0; i < aVariables.Count; i++) { TemporarySessionStruct aTemp = ((TemporarySessionStruct)aVariables[i]); if (aTemp.sItem == sItem) { return(aTemp.sValue); } } return(""); }
//Sets a temporary variable to the array <item>=<value> public void SetTemporaryVariable(string sSession, string sItem, string sValue) { //Loop through the variables ArrayList aVariables = GetTemporaryArray(sSession); for (int i = 0; i < aVariables.Count; i++) { TemporarySessionStruct aTemp = ((TemporarySessionStruct)aVariables[i]); if (aTemp.sItem == sItem) { aTemp.sValue = sValue; aVariables.RemoveAt(i); aVariables.Insert(i, aTemp); return; } } //Here we just add a new temp-struct TemporarySessionStruct aTempAdd = new TemporarySessionStruct(); aTempAdd.sItem = sItem; aTempAdd.sValue = sValue; aVariables.Add(aTempAdd); }