Advertisement
Guest User

Untitled

a guest
Mar 8th, 2020
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. test := TimeFormatHMS(%InputBoxContents%, h, m, s)
  2.  
  3. Gui, Add, Edit, x2 y149 w80 h20 vInputBoxContents, 1200000
  4. Gui, Add, Text, vVar, %test%
  5. Gui, Add, Button, gSubmit, SUBMIT
  6. Gui, Show, w404 h464, Auto Update Text String parsed from milisecond-based editbox (convert to hours, minutes, seconds)
  7. Return
  8.  
  9.  
  10. Submit:
  11. Gui, Submit, NoHide
  12. MsgBox, This is the variable contents directly from the editbox: %InputBoxContents%
  13. test2 := TimeFormatHMS(%InputBoxContents%, h, m, s)
  14. MsgBox, This is the variable contents that the text label (based on editbox input piped through the TimeFormat Function below) has: %test2%
  15. GuiControl, Text, Var, %test2%
  16. Gui, Submit, NoHide
  17. Return
  18.  
  19.  
  20. TimeFormatHMS(milli, ByRef hours=0, ByRef mins=0, ByRef secs=0, secPercision=0)
  21. {
  22. Gui, Submit, NoHide
  23. SetFormat, FLOAT, 0.%secPercision%
  24. milli /= 1000.0
  25. secs := mod(milli, 60)
  26. SetFormat, FLOAT, 0.0
  27. milli //= 60
  28. mins := mod(milli, 60)
  29. hours := milli //60
  30. return hours . ":" . mins . ":" . secs
  31. }
  32.  
  33. GuiClose:
  34. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement