Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

not running the while loop

$
0
0

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         
  1. 512
  2. 2004
  3. 2039
  4. 2039
  5. 3317
  6. 2039
  7. 2039
  8. 3290
  9. 503
  10. 3015
  11. 510
  12. 3015
  13. 503
  14. 3056
  15. 1014
  16. 3013
  17. 3582
  18. 3241
  19. 2038
  20. 1015
  21. 3572
  22. 2046
  23. 1023
  24. 255
  25. 2973
  26. 100
  27. 600
  28. 247
  29. 1022
  30. 503
  31. 1860
  32. 3536
  33. 980
  34. 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)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>