Jump to content

Search the Community

Showing results for tags 'Write'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 16 results

  1. good morning sirs. please i have a request from you. i have an variable to Read a data from a file this data is Encrypted and when i read it i Decrypte it. for that i need a function to Write a ini data to string. ;#Function# ===================================================================================================================== ; Name............: _IniReadFromString ; Description.....: Returns the value of a key in a specific section of an ini-formatted string ; Syntax..........: _IniReadFromString($szInput, $szSection, $szKey, $Default) ; Parameters......: ;   $szInput - The string that contains data in ini format ;   $szSection   - The sectionname (just as in IniRead) ;   $szKey   - The keyname (just as in IniRead) ;   $Default - The default value if the key does not exist or reading failed (just as in IniRead) ; Return values ..: ;   Success  - Returns the read value ;   Failure  - Returns $Default ; Author .........: FichteFoll ; Remarks ........: Works for Unicode as well as for ANSI ; Related ........: IniRead, _IniReadSectionFromString ; Link ...........; See on top ; Example ........; $var = _IniReadFromString(StringFormat("[Sect]\r\nMyKey1=value1\r\nMyKey2=value2"), "Sect", "MyKey2", "no_value") ; =============================================================================================================================== Func _IniReadFromString($szInput, $szSection, $szKey, $Default) $szInput = StringStripCR($szInput) ;~  Local $aRegMl = StringRegExp($szInput, "\[" & __StringEscapeRegExp($szSection) & "\]\n+(?:[^\[].*?=.*\n)*" & __StringEscapeRegExp($szKey) & "=(.*)\n?(",3) Local $aRegMl = StringRegExp($szInput, "\[" & __StringEscapeRegExp($szSection) & "\]\n+(?:[^\[].*?=.*\n)*" & __StringEscapeRegExp($szKey) & "=(.*)\n?", 3) If @error Then Return SetError(1, 0, $Default) ; key not found    Return $aRegMl[0] EndFunc;==>_IniReadFromString ; ############################################################################################################################### ; =============================================== ; = Internal Use Only ; =============================================== Func __StringEscapeRegExp($szExp) Return StringRegExpReplace($szExp, "([\(\)\[\]\{\}\\\/\?\.\\|\+])", "\\$1") ; ()[]{}\/?.|+ EndFunc;==>__StringEscapeRegExp like this function Read the ini from string. please ihelp me thanks in advance
  2. (Edited from original. Please note that I AM NOT AN AUTOIT EXPERT. I write code using Autoit frequently but I am no expert, especially when it comes to I/O. So any remarks that start with "Why did you..." can be answered by referring to the first sentence. This project was done in Autoit because of an interface I built to display the data.) Attached is a program and ascii input file I wrote to read stock price data, convert it to binary and then read it back into the program in binary. The goal was to show increased performance for reading the files in binary and provide a demo on how to read/write binary for int32, int64, double and strings for anyone who might find it helpful. The results on my PC show the following: Time to read ascii file only: 456.981951167202 Ascii read & process time: 6061.83075631701 Binary write file time: 14787.9184635239 Time just to read binary file: 42.418867292311 Binary read and process time: 4515.16129830537 A couple things to note: 1) The 32 MB ascii file took 10x longer to read than the 15 MB binary file. Not entirely sure why. Both were read into a buffer. 2) The Binary write takes a long time but I made no effort to optimize this because the plan was to write this file one time only so I don't mind if it takes longer to write this file. I care much more about how long it takes to read the file because I will be reading it many times. 3) There was a modest gain in converting the ascii file to binary in terms of file size and reading speed. So big picture... not sure it's worth the effort to convert the files to binary even though most of the data is numerical data in the binary file. That was actually surprising as I expected there would be more of a difference. Any ideas on how to get the binary data to read at a faster rate would be great. binary.au3 2019_02_08.zip
  3. Currently, I'm working on a program that will display Dialog boxes with either Yes or No. For each dialog, I reward the user with X amount of Credits. I'm hoping to output the amount of credits to a cell in a column (there will be 20 different columns). It will only post to a row that is equal to today's date (first column). If no row exists yet with the current date, it will start a new row. Any suggestions? Thank you
  4. I have 2 items (a field box and a bypass checkbox). every time the box is checked i need the field to become writable. unchecked is read only displaying some text. this is as far as i got as I am stuck at making it read/write toggle #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500) Global $hCombo = GUICtrlCreateInput("", 10, 10, 200, 20, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlSetBkColor($hCombo,0xe7e5e5) Global $cbox = GUICtrlCreateCheckbox ("", 40,50,10,20) GUICtrlSetState($cbox, $GUI_Unchecked) GUISetState() Global $sCurrCombo = "" While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cbox If GUICtrlRead($cbox) <> $sCurrCombo Then $sCurrCombo = GUICtrlRead($cbox) GUICtrlSetStyle ($hCombo, $SS_LEFTNOWORDWRAP) GUICtrlSetBkColor($hCombo,0xFFFFFF) MsgBox(0, "Choice", "PLease enter the text") EndIf EndSwitch WEnd
  5. Hi all, Is there a way to write a string to a cell in Excel without replacing what may be already in that cell? Can this be achieved with a single function? Or will I need to read any potential data first, then join it, and then write to that cell? As the write function replaces what is already in the cell. Thanks
  6. Since my last topic were closed because bot scripting aren't allowed to be discussed anymore on here. Could anyone possibly give me a good example to learn memory read/write? , i can't figure out anything else which would be a good level of difficulty to practice than "tetris bot" but since it aint legal, i wont be asking for that let me know ur ideas and i would highly appreciate if examples could be posted (My last project was a imgsrch/pxlsrch) so thought i woud move on to memory read/write, if this somehow came out wrong lmk. AND NO I'M NOT ASKING FOR A FULL CODE I WANNA CODE/SCRIPT IT MY SELF, Just show me some simple examples of Memory read/write if u can/will TYVM. Dequality.
  7. Hello Autoit Scripters, Using Autoit v3.3.14.1 in Windows 7, I'm trying to write an array of X rows by 34 columns to an Excel 2000 sheet as follows: _Excel_RangeWrite ($workbook, $newsheet, $outarray) It only works up to 160 rows. An array longer than that writes nothing or hangs the system. This needs to work with up to about 32,000 rows. I've displayed $outarray right before the writing function, and it's perfect. I searched around and found an alternative to _Excel_RangeWrite that uses a different approach based on that COM stuff. It gives the same problem! The problem doesn't appear to be affected by how much data is stored in the array, only the number of rows. I must be overlooking something, like maybe a system setting. Any help would be appreciated. Thanks in advance!
  8. hey guys, anyone knows how to write a string between two other strings like for example: To write AbzhdfX_d between ElseIf $sVideoLink1 = " and " then _IEAction ($oA, "click"), Simpler: to write a between b and c ,but automatically
  9. hello guys, i have this list of youtube links: youtu.be/3bGqROF5ZWk youtu.be/mWRsgZuwf_8 youtu.be/DK_0jXPuIr0 youtu.be/NywWB67Z7zQ youtu.be/9fL5iWgWwno youtu.be/jofNR_WkoCE youtu.be/olFEpeMwgHk youtu.be/IgKWPcpwFDs and i'd like to put them between these quotes below: ElseIf $sVideoLink1 = " " then _IEAction ($oA, "click") ElseIf $sVideoLink2 = " " then _IEAction ($oA, "click") ElseIf $sVideoLink3 = " " then _IEAction ($oA, "click") ElseIf $sVideoLink4 = " " then _IEAction ($oA, "click") ElseIf $sVideoLink5 = " " then _IEAction ($oA, "click") ElseIf $sVideoLink6 = " " then _IEAction ($oA, "click") ElseIf $sVideoLink7 = " " then _IEAction ($oA, "click") but the problem is i have a lot of video links i want to put in there and everytime i put one, the VideoLinkNr. must be +1 if you know what i mean... can anyone help or give a clue
  10. Ok so thus far the script does what it's suppose to do.. to a point. There are two complications and they are as follows: There is suppose to be ONE GUI that opens up. When i run the script it opens, but when i close it another identical one opens behind it. When i click save on the first GUI it saves like it's supposed too. BUT when i close it and reopen it, it's suppose to open with the info that was saved. I'm no pro coder, maybe it's something very small i'm not getting. Some help would be highly appreciated. Yea.. i have it saving alot :3 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> Do $pass = InputBox("Enter Password", "Please enter the password", "", "*", 150, 120) If $pass <> "Password" Then EndIf If (@error == 1) Then Exit ; Until $pass == "123" MsgBox(0, "Success", "Correct password" & @CRLF & "") Global $sConfigPath = @ScriptDir & "\Settings.ini" ProgressOn("Title", "Loading program", "Loading...") For $i = 0 To 100 ProgressSet($i) Sleep(5) Next ProgressSet(50, "Half Way.") Sleep(250) ProgressSet(100, "Done!") Sleep(750) ProgressOff() #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Title", 610, 477, 206, 143) $Input1 = GUICtrlCreateInput("Date", 480, 16, 113, 21) $Input2 = GUICtrlCreateInput("Title", 16, 56, 577, 21) $Edit1 = GUICtrlCreateEdit("", 16, 80, 577, 329) $Button1 = GUICtrlCreateButton("Save", 520, 424, 75, 25, $BS_DEFPUSHBUTTON) $idProgressbar1 = GUICtrlCreateProgress(16, 424, 454, 17) $StatusBar1 = _GUICtrlStatusBar_Create($Form1) GUICtrlSetColor(-1, 32250) GUISetState(@SW_SHOW) Local $iWait = 20; wait 20ms for next progressstep Local $iSavPos = 0; progressbar-saveposition Local $idMsg, $idM ; Loop until the user exits. Do $idMsg = GUIGetMsg() If $idMsg = $Button1 Then GUICtrlSetData($Button1, "Stop") For $i = $iSavPos To 100 If GUICtrlRead($idProgressbar1) = 50 Then MsgBox($MB_SYSTEMMODAL, "Info", "half is done...", 1) $idM = GUIGetMsg() If $idM = -3 Then ExitLoop If $idM = $Button1 Then GUICtrlSetData($Button1, "Next") $iSavPos = $i;save the current bar-position to $iSavPos ExitLoop Else $iSavPos = 0 GUICtrlSetData($idProgressbar1, $i) Sleep($iWait) EndIf Next If $i > 100 Then ; $iSavPos=0 GUICtrlSetData($Button1, "Click") EndIf If GUICtrlSetData($Button1, "Click") Then IniWrite($sConfigPath, "Date", "Input1", GUICtrlRead($Input1)) IniWrite($sConfigPath, "Title", "Input2", GUICtrlRead($Input2)) IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) EndIf If IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) Then GUICtrlSetData($Button1, "Done") EndIf EndIf Until $idMsg = $GUI_EVENT_CLOSE GUICtrlSetData($Input1, IniRead($sConfigPath, "Date", "Input1", "Date")) GUICtrlSetData($Input2, IniRead($sConfigPath, "Title", "Input2", "Title")) GUICtrlSetData($Edit1, IniRead($sConfigPath, "Edit", "Edit1", "Start writing...")) While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ; Note: Exit needs to be changed to ExitLoop ; for any code after the loop to execute. ExitLoop EndSwitch If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop If $idMsg = $Button1 Then SendMyData() WEnd Func Button1Click() IniWrite($sConfigPath, "Date", "Input1", GUICtrlRead($Input1)) IniWrite($sConfigPath, "Title", "Input2", GUICtrlRead($Input2)) IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) EndFunc ;==>Button1Click IniWrite($sConfigPath, "Date", "Input1", GUICtrlRead($Input1)) IniWrite($sConfigPath, "Title", "Input2", GUICtrlRead($Input2)) IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) Func SendMyData() FileDelete('Settings.ini') $data = "[General]" & @CRLF & GUICtrlRead($Input2) & @CRLF & @CRLF & GUICtrlRead($Edit1) FileWrite('\Settings.ini', $data) MsgBox(0, 'Info', 'Data saved') EndFunc ;==>SendMyData #EndRegion ### END Koda GUI section ###
  11. First, the value of my $LineArray[0] is "歌词制作 生态。破坏".. And whenever I tried to run this code: FileWriteLine($PathName, $LineArray[0] & @CRLF) The line of the created file produced the "???? ?????" null characters.. Now, what can I do to make it write the original (I think) Chinese characters?
  12. For example my GUICtrlCreateEdit() contains: Line 1 Line 2 Line 3 When I IniWrite() the content of it, the value will be look like this: [SectionName] Key=Line 1 Line 2 Line 3 But when I IniRead() that key like this: GUICtrlCreateEdit(IniRead(@ScriptDir & "/data.ini", "SectionName", "Key", ""), 1, 1, 200, 100) The value of the GUI edit field is only "Line 1".. How can I INI write and read a text with line breaks in a GUICtrlCreateEdit() ?
  13. For example I have a list like this.. How can I store all the list items on that GUI program into a string with the following format: $IniKey = "item1, item2, item3" Thanks in advanced!
  14. I wrote a script that is designed to log at least 10,000 lines of data. While timing it in the beginning, I figured this will take a while so I decided to afk. I came back shortly and found an error came up in the script C:\Program Files (x86)\AutoIt3\Include\Excel.au3 (451) : ==> The requested action with this object has failed.: $oExcel.Activesheet.Cells($sRangeOrRow, $iColumn).Value = $sValue $oExcel.Activesheet.Cells($sRangeOrRow, $iColumn).Value = $sValue^ ERROR About six thousand lines were produced in the file successfully, but I was wondering what could have caused this error?
  15. I'm trying to write a test .txt file with test being the word I want to put into the GUI window. Kinda stuck any help would be appreciated. (work in progress) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> #include <StaticConstants.au3> #include <EditConstants.au3> Global $file = FileOpen("test.txt") GUICreate("Disclaimer", 500, 400) ;Creates the GUI window fileread($file, 400) GUISetState(@SW_SHOW) ;Shows the GUI window sleep(5000) fileclose($file)
  16. This line was originally used instead of the FileOpen and FileWrite commands _WinAPI_WriteFile($hFile, DllStructGetPtr($tBuffer), StringLen($sText), $nBytes) But WinAPI would only erase my prev text. But FileOpen and FileWrite doesn't work. The file is generated, but no text is inserted. #include <WinAPI.au3> #include <Date.au3> DirCreate("C:\Inventory\Log") Global $sFile, $hFile, $sText, $nBytes, $tBuffer $aDato = _Date_Time_GetSystemTime() $Dato = _Date_Time_SystemTimeToArray($aDato) _WriteToLog("Topic", "text") _WriteToLog("Topic2", "text2") Func _WriteToLog($labelname, $Recv) $sFile = 'C:\Inventory\Log\' & $dato[2] & $dato[0] & $dato[1] & '.log' $sText = '' & $labelname & ' | ' & $Recv & ' ' & @CRLF & '' $tBuffer = DllStructCreate("byte[" & StringLen($sText) & "]") DllStructSetData($tBuffer, 1, $sText) $hFile = _WinAPI_CreateFile($sFile, 1) FileOpen($sFile, 1) FileWrite($sFile, $sText) _WinAPI_CloseHandle($hFile) ConsoleWrite('1) ' & FileRead($sFile) & @CRLF) EndFunc ;==>_WriteToLog Thanks for all help =)
×
×
  • Create New...