Jump to content

macran

Members
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

427 profile views

macran's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. TRY: 12= length("hello world!") $oItem.Getinspector.Wordeditor.Range(12).Paste
  2. Although there are SAP UDFs in the forums, I have actually been automating SAP with native Autoit code because the SAP GUI itself is the front end window and therefore can send key actions.You usually use shortcut keys and TAB keys.Of course, SAP UDF is better, which allows more accurate access to controls in SAP GUI and acquisition or manipulation
  3. @mLipok Can I generate a XML file with doctype declare such as '<!DOCTYPE SCHEMA SYSTEM "HGWSPZJK.dtd">' by using XML.AU3 the whole xml file like as follow: <?xml version="1.0" encoding="GBK"?> <!DOCTYPE SCHEMA SYSTEM "HGWSPZJK.dtd"> ;I can not generate this line <SCHEMA CRC="HGWSPZ201808_9131011571786229XM_CRC.XML" SSSQ="201808" CHSNAME="海关完税凭证抵扣清单" NAME="HGWSPZ"> <TAXPAYER CJRMC="西格玛奥德里奇(上海)贸易有限公司" CJRDM="9131011571786229XM" CJLX="DKZK" RECORDCOUNT="411" SBRQ="2018-08-31" NSRMC="西格玛奥德里奇(上海)贸易有限公司" SWSBH="9131011571786229XM"> <Records> <Record BZ="" JKKADM="2244" JKKAMC="上海快件" SE="5907.82" TFRQ="2018-08-23" FPHM="224420181000752586-L02"/> <Record BZ="" JKKADM="2244" JKKAMC="上海快件" SE="4742.4" TFRQ="2018-08-21" FPHM="224420181000743016-L01"/> <Record BZ="" JKKADM="2244" JKKAMC="上海快件" SE="18720" TFRQ="2018-08-14" FPHM="224420181000719215-L01"/> <Record BZ="" JKKADM="2244" JKKAMC="上海快件" SE="9575.2" TFRQ="2018-08-14" FPHM="224420181000719204-L01"/> </Records> </TAXPAYER> </SCHEMA> someone said that use CreateDocumentType https://docs.microsoft.com/zh-cn/dotnet/api/system.xml.xmldocument.createdocumenttype?redirectedfrom=MSDN&view=netframework-4.7.2#System_Xml_XmlDocument_CreateDocumentType_System_String_System_String_System_String_System_String_ someone said that use loadxml I confused that can I only use FileWrite () write the string as above and save as test.xml thanks
  4. I want to generating a XML file (test.xml) like as follow: <?xml version="1.0" encoding="GBK"?> <!DOCTYPE SCHEMA SYSTEM "HGWSPZJK.dtd"> ;I can not generate this line <SCHEMA CRC="HGWSPZ201808_9131011571786229XM_CRC.XML" SSSQ="201808" CHSNAME="HGWSDKQD" NAME="HGWSPZ"> <TAXPAYER CJRMC="sigmagroup" CJRDM="9131011571786229XM" CJLX="DKZK" RECORDCOUNT="411" SBRQ="2018-08-31" NSRMC="sigmagroup" SWSBH="9131011571786229XM"> <Records> <Record BZ="" JKKADM="2244" JKKAMC="shanghai" SE="5907.82" TFRQ="2018-08-23" FPHM="224420181000752586-L02"/> <Record BZ="" JKKADM="2244" JKKAMC="shanghai" SE="4742.4" TFRQ="2018-08-21" FPHM="224420181000743016-L01"/> <Record BZ="" JKKADM="2244" JKKAMC="shanghai" SE="18720" TFRQ="2018-08-14" FPHM="224420181000719215-L01"/> </Records> </TAXPAYER> </SCHEMA> I use XML.UDF Local $oXMLile=_XML_CreateFile(@ScriptDir&"\test.xml","",True) but there is no function CreateDocumentType It is no effort even I test use Local $doct=$oXMLfile.CreateDocumentType("SCHEMA", null, "HGWSPZJK.dtd", null) $oXmlfile.appendChild($doct) pls help me thanks.
  5. I use mysql.au3 to connect mysql database . If restart the server ,the client how to reconnect mysql? The function prototype is _MySQL_Options($MySQL_ptr, $option, $arg = 0, $type = "ptr") so, _MySQL_Options($MysqlConn,$MYSQL_OPT_RECONNECT, ?, ?) pls help me,thanks!
  6. thanks! Jguinch,Johnone but the about dialog have a icon and rightclick title bar contextmenu are "restor","move","size","minimize","maximize","close" I want there have no icon and contextmenu only have "move" and "close" , not have above all but the two is enable. in a word, like about SciTe dialog.
  7. HI,@jguinch msg create by menu not button can you help me again .thanks
  8. some time it is ok ,some time it is error now it is ok
  9. how to create a about modle dialog like FileOpenDialog that have parent and can not be shown on taskbar ,or please look SciTe->Help->about scite lite as attach file thanks!
  10. Func _SQLite_SQLiteExe($sDatabaseFile, $sInput, ByRef $sOutput, $sSQLiteExeFilename = -1, $bDebug = False) If $sSQLiteExeFilename = -1 Or $sSQLiteExeFilename = Default Then $sSQLiteExeFilename = "sqlite3.exe" If Not FileExists($sSQLiteExeFilename) Then Local $sInlineVersion = "_" & Call('__SQLite_Inline_Version') If @error Then $sInlineVersion = "" ; no valid SQLite version define so use any version Local $sSQLiteExe_FilePath = @TempDir & "\" $sSQLiteExeFilename = __SQLite_Download_SQLite3File($sSQLiteExe_FilePath, "sqlite3", $sInlineVersion, ".exe", True) MsgBox(0,"","download") If @error Then Return SetError(2, 0, $SQLITE_MISUSE) ; Can't Found sqlite3.exe $sSQLiteExeFilename = $sSQLiteExe_FilePath & $sSQLiteExeFilename EndIf EndIf If Not FileExists($sDatabaseFile) Then Local $hNewFile = FileOpen($sDatabaseFile, $FO_OVERWRITE + $FO_CREATEPATH) If $hNewFile = -1 Then Return SetError(1, 0, $SQLITE_CANTOPEN) ; Can't Create new Database EndIf FileClose($hNewFile) EndIf Local $sInputFile = _TempFile(), $sOutputFile = _TempFile(), $iRval = $SQLITE_OK Local $hInputFile = FileOpen($sInputFile, $FO_OVERWRITE) If $hInputFile > -1 Then $sInput = ".output stdout" & @CRLF & $sInput FileWrite($hInputFile, $sInput) FileClose($hInputFile) Local $sCmd = @ComSpec & " /c " & FileGetShortName($sSQLiteExeFilename) & ' "' _ & FileGetShortName($sDatabaseFile) _ & '" > "' & FileGetShortName($sOutputFile) _ & '" < "' & FileGetShortName($sInputFile) & '"' Local $nErrorLevel = RunWait($sCmd, @WorkingDir,@SW_HIDE) MsgBox(0,"",@error) ;error=0 $nErrorLevel=1 If $bDebug = True Then Local $nErrorTemp = @error If @error Then __SQLite_Print('@@ Debug(_SQLite_SQLiteExe) : $sCmd = ' & $sCmd & @CRLF & '>ErrorLevel: ' & $nErrorLevel & @CRLF) SetError($nErrorTemp) EndIf MsgBox(0,"",$nErrorLevel) If @error = 1 Or $nErrorLevel = 1 Then $iRval = $SQLITE_MISUSE ; SQLite.exe not found Else $sOutput = FileRead($sOutputFile, FileGetSize($sOutputFile)) If StringInStr($sOutput, "SQL error:", 1) > 0 Or StringInStr($sOutput, "Incomplete SQL:", 1) > 0 Then $iRval = $SQLITE_ERROR ;MsgBox(0,"",$iRval); SQL error / Incomplete SQL EndIf EndIf Else $iRval = $SQLITE_CANTOPEN ; Can't open Input File EndIf If FileExists($sInputFile) Then FileDelete($sInputFile) Switch $iRval Case $SQLITE_MISUSE SetError(2) ;MsgBox(0,"",$sSQLiteExeFilename) Case $SQLITE_ERROR SetError(3) Case $SQLITE_CANTOPEN SetError(4) EndSwitch Return $iRval EndFunc ;==>_SQLite_SQLiteExe I test the UDF _SQLite_SQLiteExe in help file the result is" Can't Found sqlite3.exe" . I find the reason is @error=0 but $nErrorLevel=1which return from RunWait(). why??
  11. How to saveas an excel file to text file or create a text file by read data from an excel file with format is utf-8?
  12. $ar_array=_ExcelReadSheetToArray($arexcel,2) ;----from 2nd row $weekly_array=_ExcelReadSheetToArray($weeklyexcel,2,5) ;----from 2nd row and 5th col how to get the same effect by use _Excel_RangeRead? thanks!
  13. @jchd I just copy the example script from AUTOIT3 HELP about _SQLite_SQLiteExe to test I only change cod from ' _SQLite_SQLiteExe($sDbFile, $sIn, $sOut,-1,True)' to ' _SQLite_SQLiteExe($sDbFile, $sIn, $sOut,"C:Sqlitesqlite3.exe",True) ' beause sqlite3 install in c:sqlite F5 ,ERROR: Sqlite3.exe file not found then I copy the file" sqlite3.exe" to @scriptdir , F5 ,also ERROR: Sqlite3.exe file not found then I copy the files"sqlite3.def" and"sqlite3.dll" to @scriptdir ,F5, also ERROR: Sqlite3.exe file not found system: win7 64bit autoit:3.3.12.0 sqlite3:3.8.8.3 #include <File.au3> #include <SQLite.au3> #include <SQLite.dll.au3> #include <StringConstants.au3> ; Filenames Local $sTsvFile = FileGetShortName(_TempFile(@ScriptDir, "~", ".tsv")) Local $sDbFile = FileGetShortName(_TempFile(@ScriptDir, "~", ".db")) ; Create Tsv File FileWriteLine($sTsvFile, "a" & @TAB & "b" & @TAB & "c") FileWriteLine($sTsvFile, "a1" & @TAB & "b1" & @TAB & "c1") FileWriteLine($sTsvFile, "a2" & @TAB & "b2" & @TAB & "c2") ; import (using SQLite3.exe) Local $sIn, $sOut, $i, $sCreate = "CREATE TABLE TblImport ("; For $i = 1 To _StringCountOccurance(FileReadLine($sTsvFile, 1), @TAB) + 1 $sCreate &= "Column_" & $i & "," Next $sCreate = StringTrimRight($sCreate, 1) & ");" $sIn = $sCreate & @CRLF ; Create Table $sIn &= ".separator \t" & @CRLF ; Select @TAB as Separator $sIn &= ".import '" & $sTsvFile & "' TblImport" & @CRLF _SQLite_SQLiteExe($sDbFile, $sIn, $sOut,"C:\Sqlite\sqlite3.exe",True) If @error = 0 Then ;Show Table (using SQLite3.dll) Local $iRows, $iColumns, $aRes _SQLite_Startup() ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) _SQLite_Open($sDbFile) _SQLite_GetTable2d(-1, "SELECT ROWID,* FROM TblImport;", $aRes, $iRows, $iColumns) _SQLite_Display2DResult($aRes) ; Output to Console _SQLite_Close() _SQLite_Shutdown() Else If @error = 2 Then ConsoleWrite("ERROR: Sqlite3.exe file not found" & @CRLF) Else ConsoleWrite("ERROR: @error=" & @error & " when calling _SQLite_SQLiteExe" & @CRLF) EndIf EndIf ; Remove Temp Files FileDelete($sTsvFile) FileDelete($sDbFile) ; Output: ; rowid Column_1 Column_2 Column_3 ; 1 a b c ; 2 a1 b1 c1 ; 3 a2 b2 c2 Func _StringCountOccurance($sSearchString, $sSubString, $iCaseSense = $STR_NOCASESENSE) ; Returns Number of $sSubString in $sSearchString Local $iOccCnt = 1 Do If StringInStr($sSearchString, $sSubString, $iCaseSense, $iOccCnt) > 0 Then $iOccCnt += 1 Else ExitLoop EndIf Until 0 Return $iOccCnt - 1 EndFunc ;==>_StringCountOccurance
  14. I have the same trouble. I copy the exe from @tempdir to @scriptdir and rename to 'sqlite3.exe' but result is also ERROR: Sqlite3.exe file not found
  15. How can i use MS_AccessDB.au3? clicked "popup" -copy-save as access.au3 is right? why I can not open the file MS_AccessDB unziped by MS_AccessDB.zip thanks!
×
×
  • Create New...