Ok, I am having one of thoughts days where anything simple doesn't work. I do these small programs all the time and now, I don't know why it will not work. What am I doing wrong? Why is not working? Frustrating day.
ram.txt-->file here
Plain Text
512 2004 2039 2039 3317 2039 2039 3290 503 3015 510 3015 503 3056 1014 3013 3582 3241 2038 1015 3572 2046 1023 255 2973 100 600 247 1022 503 1860 3536 980 3290
Code here.
AutoIt
$num=0 $file = FileOpen(@ScriptDir&"\ram.txt", 1) If $file = -1 Then ; Check if file opened for writing OK MsgBox(0, "Error", "Unable to open ram.txt data file.") Exit EndIf $afile = FileOpen(@ScriptDir&"\ramout.txt", 1) If $afile = -1 Then ; Check if file opened for writing OK MsgBox(0, "Error", "Unable to open ramoutput.txt data file.") Exit EndIf While 1 $num = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0,"","start of switch",5) Switch $num Case 100 To 128 $num = "128" Case 129 To 256 $num = "256" Case 257 To 512 $num = "512" Case 513 To 640 $num = "640" Case 900 To 1100 $num = "1g" Case 1900 To 2100 $num = "2g" Case 2900 To 3100 $num = "3g" Case 3900 To 4100 $num = "4g" Case Else $num = $num EndSwitch FileWriteLine($afile,$num) ;MsgBox(0,"","RAM is__:"&$num) Wend FileClose($file) ;for ram.txt Sleep(500) FileClose($afile) ;for ramout.txt Sleep(500) MsgBox(0,"","Your ram has been updated.",8)