Recently Browsing 0 members
No registered users viewing this page.
Can someone explain what I've done wrong?
The code is supposed to call a function which brings up a GUI with "Pass" and "Fail" buttons. $pass is True/False, using in the following code:
Func getStatus($pass) If($pass = "True") Then Return " passed " Else Return " failed " EndIf EndFunc I write a line to a .txt file, saying whether Step # passed or failed and how long it took. Then, if the button pressed was "Fail", an InputBox was created, which is the "Return" of SanityCheckGUI() which goes into $failLog. Refer to code below:
Local $failLog = SanityCheckGUI($pass, $stepMessage[$step]) ;Returns a message to log if the step failed. FileWrite($filename, _Now() & ": Step " & $step & getStatus($pass) & "and took " & (TimerDiff($timer) / 1000) & " seconds." & @CRLF) If($failLog <> "") Then FileWrite($file, _Now() & ": " & $failLog & @CRLF) EndIf However... this is what I actually get when I press:
Pass: (This is correct)
14/11/2017 12:30:27 PM: Step 2 passed and took 1.48731919633846 seconds.
Fail: (How does "jfuer6", the thing I put into the InputBox, come before the long line and cut it in half?)
14/11/2017 12:29:54 PM: jfuer6
ailed and took 4.73581847206323 seconds.
Expected for Fail:
14/11/2017 12:29:54 PM: Step 2 failed and took 4.73581847206323 seconds.
14/11/2017 12:29:54 PM: jfuer6
Thank you in advance.
Is it possible , and how can I read and write txt files from Icloud (apple service) ?
Let me try to explain my application.
On my Ipad and Iphone I create txt files. On my windows computer it is possible to read and modify these files manually, by logging in on www.icloud.com.
What I want to make is an auto-it script who reads the txt file and create an new txt file on www.icloud.com, so I can acces these on my ipad and/or phone.
This code will read text data from txt file. However, if I use '$Newtext &= $convert' then $convert is saved as strings, not hex value.
For example, if $convert = 0x300020FF and $bNewText = Test then the result is 0x333030303230464654657374. (Wrong)
What I want is 0x300020FF54657374. How can I modify my script?
For $i = $y-1 To Ubound($split) - 1 $convert = "0x" & $split[$i] $Newtext &= $convert $NewLen_hex = BinaryLen ($convert) $i=$i+1 $split[$i] = $split[$i] $split[$i] = StringRegExpReplace($split[$i], "<cf>", @CRLF) $split[$i] = StringRegExpReplace($split[$i], "<lf>", @LF) $split[$i] = StringRegExpReplace($split[$i], "<cr>", @CR) $bNewText = _WinAPI_WideCharToMultiByte($split[$i], $CP_SHIFT_JIS) if $i = Ubound($split) - 1 Then $bNewText &= Chr(0) EndIf $Newtext &= $bNewText $NewLen = $NewLen_hex + BinaryLen ($bNewText) Next (...) (...) $Newfile = BinaryMid($Newfile_header,1) & BinaryMid($Newtext,1) $hNewfile = FileOpen ("NEW_"&$Name, 2+16) FileWrite ($hNewfile, $Newfile) FileClose ($hNewfile) TrayTip ("Importer", "Finish!", 3) sleep (3000)
I have searched and found many posts on READING CSV. What I need to do is WRITE CSV.
Typically I have a Listview, I use @guinness's excellent _GUICtrlListView_CreateArray to read that LV to Array. Currently I use _FileWriteFromArray to write the output. It is fast and it is easy.
The benefits of using these Array functions are their inherit flexibility. The code is portable. Plug it into LV report and you can write to file instantly. No formatting issues.
To be sure, my problem is not with the Listview or Array. My problem is with the file write to CSV: it should be fast, accurate and efficient.
Part of the problem is Microsoft Excel's insistence that my CSVs are not what they appear to be...
I am inspired by the simplicity of SQLITE3.EXE's dot command options:
.headers on .mode csv .once output.csv
Problem is that I want to export the text packed in characters, such as ' " ' with fields delimited by another character, such as ' , '.
Current method using _FileWriteFromArray outputs data like this
12-04-2016| 0.00| 131.00|131|Description 12-04-2016| 0.00| 132.00|132|Description 132 rece 12-04-2016| 998.00| 0.00|998|Description Receipt 12-04-2016| 0.00| 900.00|900|Description What I want to achieve is this:
"12-04-2016"," 0.00"," 131.00","131","Description" "12-04-2016"," 0.00"," 132.00","132","Description 132 rece" "12-04-2016"," 998.00"," 0.00","998","Description Receipt" "12-04-2016"," 0.00"," 900.00","900","Description" I have done this. The long way. I have written the output one $aResult[$i] item at a time, spaced with the $text & $field markers. I have placed this in an array with additional columns just to fit in the formatting. I have also played with the idea of inserting the array into a sqlite db, then run sqlite3's dot commands on that.
Is there a different method? Is there an efficient method to specify FileWriteFromArraytoCSV? Does anyone have ideas? I am sure I will know how to code this, I just need advice on the most efficient way of going about it. If I missed any threads, please enlighten me.
Thanks for reading