Hi, i have a variable (floating number - could be positive or negative), i wish to print it into a text file, how can i keep the format in such a way that it always has 4 digits ahead of decimal and 2 after decimal
basically i have total 7 columns in the text file to print the variable ;
eg: variable = 1.235, output requied = 0001.24
variable=-23.55555, output required =-023.56
Dumb question, but say I have a loop:
dim $i Do sleep(1000) if $i = ; how do i do a function that enters this IF statement every 10 loops? ; do stuff every 10 EndIf Until $i = 100
- what commands in the if statement do I need to use to make it pass, and on every 10th loop, it enters the if statement. ?
I want the number in a file to be overwritten with the next number up each time a button is pressed.
So it is pressed once, the number '1' is written to the file. It is pressed again and the number '2' overwrites the first number.
At the moment I get the number 1 written, but can't get it to overwrite. What I have so far:
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #Region ### START Koda GUI section ### Form=C:\Users\soulf\Desktop\CalcGui\RLCalc.kxf $Form1 = GUICreate("Form1", 615, 437, 426, 141) $One = GUICtrlCreateButton("1", 32, 72, 25, 25) GUICtrlSetBkColor(-1, 0xFF0000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func First () $fPath = "C:\temp\First.txt" $fOpen = FileOpen ($fPath, 2) $Counter = FileReadLine ($fpath) $counter = $counter + 1 $fWrite = filewriteline ($fPath, $counter) FileClose ($fpath) EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $One Call ("First") EndSwitch WEnd I tried a Do Until statement, but that just puts the numbers 1 to 5 in the file.
Any help would be greatly appreciated!
RunningStats calculates running (moving) statistics: Standard Deviation, Variance, and Mean . The single function _RunningStats(), queries, clears, restores, or adds to the running statistics.
Example.au3 adds 7 samples of data to running statistics and displays the results using _ArrayDisplay().
Example-Persistent-Storage.au3 adds the first 6 samples to the running statistics and stores the results in an INI file. The data is read from the INI file and restored to the running statistics. The 7th sample is added and the results displayed, matching the results from Example.au3.
Credits: John D. Cook for his article "Accurately computing running variance" at http://www.johndcook.com/blog/standard_deviation/
I started writing this UDF a while ago, so I decided to share it here.
This is an UDF full of advanced mathematical functions. It allows to work with primes, create number sequences, interpolate, calculate values of functions like Riemann zeta.
Full list of functions: