leevy
Active Members-
Posts
38 -
Joined
-
Last visited
leevy's Achievements
Seeker (1/7)
0
Reputation
-
Thanks PsaltyDS. I have found the reason, I used XMLHTTP, its url is changed by other guy.
-
I'm sure my xml file exist and hasn't been changed.
-
Hello, My tool worked well yesterday, but it says "Variable must be of type "Object"" when I run it today, I didn't update it from yesterday to today. error is: _XMLDomWrapper.au3 (451) : ==> Variable must be of type "Object".: $objNodeList = $objDoc.documentElement.selectNodes ($strXPath) $objNodeList = $objDoc.documentElement^ ERROR why?
-
Sorry for my mistakes. I was so careless today.
-
Hello, My tool worked well yesterday, but it says "Variable must be of type "Object"" when I run it today. error is: _XMLDomWrapper.au3 (451) : ==> Variable must be of type "Object".: $objNodeList = $objDoc.documentElement.selectNodes ($strXPath) $objNodeList = $objDoc.documentElement^ ERROR why?
-
Thanks all, I understand how FileWrite and FileWriteLine work now. I thought out an idea to solve this problem. $readme = stringReplace($readme, @LF, @CRLF) FileWrite($file, $readme) It works well now.
-
this is an example: #include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <IE.au3> #include <_XMLDomWrapper.au3> #include <File.au3> #include <GuiTab.au3> #Include <string.au3> Global $sFilepath, $readme _Main() Func _Main() Global $parent, $tabitem2 ; Create the GUI window and controls $parent = GUICreate("Wing 1.3", 400, 500, (@DesktopWidth - 400)/ 2, (@DesktopHeight - 500) / 2) $OLD = _SetThemes(0) GUISetIcon("Wing.ico") $tab = GUICtrlCreateTab(10, 10, 382, 440,0x00000020) _SetThemes($OLD) $tabitem1 = GUICtrlCreateTabItem("aaa") $tabitem2 = GUICtrlCreateTabItem("bbb") ;wing1.3 ;------------------------------------------------------------------------------------------------------ GUICtrlCreateTabItem("readme") $createreadme = GUICtrlCreateButton("Create readme", 60, 465, 130, 20) ;------------------------------------------------------------------------------------------------------ GUICtrlCreateTabItem("") $pathlabel = GUICtrlCreateLabel("File path:", 22, 405, 80, 20, 0x0200) $hFile = GUICtrlCreateInput($sFilepath, 105, 405, 245, 20,0x0080) $hFileSel = GUICtrlCreateButton("...", 355, 405, 25, 20) $cancelbutton = GUICtrlCreateButton("Cancel", 260, 465, 60, 20) $sub = GUICreate("", 370, 340, 0, 0, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) ; Run the GUI until it is closed GUISetState(@SW_SHOW, $parent) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop case $Msg = $hFileSel $sTmpFile = FileSelectFolder("Please Select the directory", "") If @error Then ContinueLoop GUICtrlSetData($hFile, $sTmpFile) Case $msg = $createreadme $sActFile = GUICtrlRead($hFile) $file = FileOpen($sActFile&"\"&"readme.txt",2) $readme = _Getxmlvalue("resource2.xml", "/wing/readme/page") $header = _Getxmlvalue("resource2.xml", "/wing/readme/PM/aaaaa/header") $readme = stringReplace($readme, "$$header##", $header) ConsoleWrite($readme) FileWriteLine($file, $readme) FileClose($file) if $sActFile = "" Then MsgBox(4096,"message","Please select directory!",10) Else MsgBox(4096,"message","Create successfully",10) EndIf EndSelect WEnd Exit EndFunc ;==>_Main ;~ get number from a string Func _Getnumber($string) $numberstring = "" $j = StringLen($string) for $i = 1 to $j $tmpstring = StringTrimRight ($string, $j - $i) $char = StringTrimLeft($tmpstring, $i - 1) If StringIsDigit($char) > 0 Then $numberstring = $numberstring&$char EndIf Next Return $numberstring EndFunc Func _Getxmlnodes($xmlfilename,$path) $template = "" $tmpvalue = "" $sXML = $xmlfilename If _XMLFileOpen($sXML,"",-1) = -1 Then ConsoleWrite("can′t open file!" & @CRLF) Exit EndIf $tmpvalue = _XMLSelectNodes($path) $template = $tmpvalue[1] for $i = 2 to UBound($tmpvalue) - 1 $template =$template&"|"&$tmpvalue[$i] Next EndFunc Func _Getxmlvalue($xmlfilename,$path) $tmpvalue = "" $sXML = $xmlfilename If _XMLFileOpen($sXML,"",-1) = -1 Then ConsoleWrite("can′t open file!" & @CRLF) Exit EndIf $tmpvalue = _XMLGetValue($path) Return $tmpvalue[1] EndFunc ; Count the number of times substring occurs in string Func _StringCount($string, $substring) Local $i, $count = 0 For $i = 1 to StringLen($string) If StringMid($string, $i, StringLen($substring)) = $substring Then $count = $count + 1 Next Return $count EndFunc Func _getreportnum($IE) $reportnum = "" _IELoadWait($IE) ; get bug report number $reporttext = $IE.document.body.innertext $reporttextlist = StringSplit($reporttext, @LF) for $i in $reporttextlist if StringInStr($i, "ReportID:") > 0 then $reportnum = _Getnumber($i) return $reportnum EndIf Next EndFunc Func _SetThemes($Style) If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1) Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties") If Not IsArray($ret) Then Return SetError(1,0,-1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style) Return $ret[0] EndFunc this is xml: <?xml version="1.0" encoding="UTF-8" ?> - <wing> - <report> - <example1> </example1> - <example2> + <bugreport> <title>test title 2</title> <sql>TEST $$SQL## 2$$title## 2 $$teastaset## asdfa</sql> </bugreport> </example2> </report> - <readme> - <PM> - <aaaaa> <header>[Owner Name] : aaaa bbbb [Owner Phone] : 111-222-3333 [Owner Emergency Phone] : 222-222-4444 [Owner Email] : aaaa.bbbb@test.com</header> </aaaaa> </PM> <page>$$header## DATE ============================================== [Date of Release] DATE : $$releasedate## RELEASE NUMBER ============================================== [Release # on J-Drive] $$releasenum## RELEASE NAME ============================================== [Brief description of this release] $$memoname## MEMO NUMBER ============================================== $$memonum## PATCH TYPE ============================================== [Description of this type of release PF-Page Full, PP-Page Partial, CF-Client Full, CP-Client Partial, DBP-Database Patch] PP CONTENTS ============================================== [List all the contents of this release includes all packages and other files] Refer to $$releasenum##_fileList.txt for contents BACKUP INSTRUCTIONS ============================================== [Provide backup recommendation and instructions including command and directory names] 1. Backup will be finished automatically after "psoinstaller.sh" run. 2. Backup files' path is: /backup/psobackup/$$releasenum## ROLLBACK INSTRUCTIONS ============================================== [Provide rollback recommendation and instructions including command and directory names] 1. Go to backup directory: cd /backup/psobackup/$$releasenum## 2. Run roll back script: ./psorollback.sh INSTALLATION INSTRUCTION ============================================== 1. Mount to "/backup"(Standard Implementation directory) 2. Copy the whole "$$releasenum##/" to "/backup" 3. Go to directory "/backup/$$releasenum##/install-rollback/", Change attributes for the following two scripts : cd /backup/$$releasenum##/install-rollback chmod +x psoinstaller.sh chmod +x psorollback.sh 4. Run "psoinstaller.sh" to start installation: ./psoinstaller.sh Please input your site name when it prompts "Please enter site name:" $$histroydependency## Please input "y" when it prompts "Configuration instructions for the release $$releasenum## implemented?"(Please make sure config file is correct before input "y") 5. To create multi-language sites or other sites, you need to run: ./psoinstaller.sh -cs and input site name when it prompts "Please enter site name:".(1 site name every time) 6. To delete existing site name: cd /backup/psobackup/$$releasenum## ./psorollback.sh [existing site name] Input "y" when it prompts "Are you sure you want to remove the soft links for the [site name]?"(1 site name every time) 7. Redeploy the $$train## application after installation finishes. CONFIGURATION INSTRUCTION ============================================== N/A SPECIAL CUSTOMER URLS ============================================== [Provide list of special customer URLs that this patch is to be deployed to] Please refer to RT SPECIAL SITE VERIFICATION PROCEDURE ============================================== [Provide special site verification procedure for this patch if can't use standard procedure] N/A SUPERSEDES ============================================== [Provide list of releases that this patch will supersede] N/A DEPENDENCIES ============================================== [Provide specific dependency information to other releases] $$readmedependenciesdata## MISCELLANEOUS ============================================== [Provide other important information about this release] Service down time: (minutes) No Server program restart? Y/N No Server machine reboot? Y/N No Customer impact? Low PACKAGE SOURCE ====================================================== [Provide information about what is included in this release] Packages included: page PRIMARY CONTACTS =========================================================== [Provide primary contact information for this release. Should include lead for each Component and Service] $$footer##</page> </readme> </wing> maybe @LF is notavailable in txt?
-
I used FileWriteLine, still show: "aaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbccccccccccc"
-
hello, I have a question about FileWrite. I want to write a string into a file, the string is got from a xml file, please see the following: aaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb ccccccccccc I useed ConsoleWrite and got the string, the value is the same as above. but, it will show as "aaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbccccccccccc" when I write it into a file. my script is: $file = FileOpen("test.txt", 2) FileWrite($file, $string) FileClose($file) hope your help, thanks.
-
gui problem - window from hide to show
leevy replied to leevy's topic in AutoIt General Help and Support
Thanks M23, I know the reason now, I have not sorted out the logic flow, so I missed one step "GUISetState(@SW_SHOW, $sub)". Finally, thanks for the warning. the final code is the following, I add "GUISetState(@SW_SHOW, $sub)" at line 49. #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _Main() Func _Main() Global $parent, $tabitem2 ; Create the GUI window and controls $parent = GUICreate("xxxx", 400, 500, (@DesktopWidth - 400)/ 2, (@DesktopHeight - 500) / 2) $OLD = _SetThemes(0) GUISetIcon("xxxx") $tab = GUICtrlCreateTab(10, 10, 382, 440,0x00000020 ) _SetThemes($OLD) $tabitem1 = GUICtrlCreateTabItem("version") $tabitem2 = GUICtrlCreateTabItem("report") $radioAddreport = GUICtrlCreateRadio("Add reports", 25, 45, 160, 20, 000000) $radioAddreporttemplate = GUICtrlCreateRadio("Add report template", 200, 45, 150, 20, 000000) $bugreporttemplatelabel = GUICtrlCreateLabel("Template", 200, 75, 80, 20, 0x0200) $bugreporttemplate = GUICtrlCreateCombo("", 255, 75, 120, 20) GUICtrlSetData($bugreporttemplate, "report1|template|data", "report1") GUICtrlCreateTabItem("readme") GUICtrlCreateTabItem("") $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) ; Run the GUI until it is closed GUISetState(@SW_SHOW, $parent) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $tab if GUICtrlRead($tab) = 1 Then $clickAddreport = ControlClick("Wing 1.0","",$radioAddreport) EndIf case $msg = $radioAddreporttemplate GUICtrlSetState($bugreporttemplatelabel,$GUI_hide) GUICtrlSetState($bugreporttemplate,$GUI_hide) GUISetState(@SW_HIDE, $sub) case $msg = $radioAddreport GUISetState(@SW_SHOW, $sub) ; the new added GUICtrlSetState($bugreporttemplatelabel,$GUI_show) GUICtrlSetState($bugreporttemplate,$GUI_show) Case $msg = $bugreporttemplate GUIDelete($sub) Local $reporttemplate = GUICtrlRead($bugreporttemplate) if $reporttemplate = "template" Then GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("aaaa", 25, 60, 250, 20,0x0080) Else GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("bbbb", 25, 60, 250, 20,0x0080) GUICtrlCreateInput("cccc", 25, 90, 250, 20,0x0080) EndIf EndSelect WEnd Exit EndFunc;==>_Main Func _SetThemes($Style) If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1) Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties") If Not IsArray($ret) Then Return SetError(1,0,-1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style) Return $ret[0] EndFunc -
gui problem - window from hide to show
leevy replied to leevy's topic in AutoIt General Help and Support
Sorry, I must hide the sub window, because other controls will be shown when I click $radioAddreporttemplate. -
hello, I met a new problem. here is my script: #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _Main() Func _Main() Global $parent, $tabitem2 ; Create the GUI window and controls $parent = GUICreate("xxxx", 400, 500, (@DesktopWidth - 400)/ 2, (@DesktopHeight - 500) / 2) $OLD = _SetThemes(0) GUISetIcon("xxxx") $tab = GUICtrlCreateTab(10, 10, 382, 440,0x00000020 ) _SetThemes($OLD) $tabitem1 = GUICtrlCreateTabItem("version") $tabitem2 = GUICtrlCreateTabItem("report") $radioAddreport = GUICtrlCreateRadio("Add reports", 25, 45, 160, 20, 000000) $radioAddreporttemplate = GUICtrlCreateRadio("Add report template", 200, 45, 150, 20, 000000) $bugreporttemplatelabel = GUICtrlCreateLabel("Template", 200, 75, 80, 20, 0x0200) $bugreporttemplate = GUICtrlCreateCombo("", 255, 75, 120, 20) GUICtrlSetData($bugreporttemplate, "report1|template|data", "report1") GUICtrlCreateTabItem("readme") GUICtrlCreateTabItem("") $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) ; Run the GUI until it is closed GUISetState(@SW_SHOW, $parent) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop case $msg = $tab if GUICtrlRead($tab) = 1 Then $clickAddreport = ControlClick("Wing 1.0","",$radioAddreport) EndIf case $msg = $radioAddreporttemplate GUICtrlSetState($bugreporttemplatelabel,$GUI_hide) GUICtrlSetState($bugreporttemplate,$GUI_hide) GUISetState(@SW_HIDE, $sub) case $msg = $radioAddreport GUICtrlSetState($bugreporttemplatelabel,$GUI_show) GUICtrlSetState($bugreporttemplate,$GUI_show) Case $msg = $bugreporttemplate GUIDelete($sub) Local $reporttemplate = GUICtrlRead($bugreporttemplate) if $reporttemplate = "template" Then GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("aaaa", 25, 60, 250, 20,0x0080) Else GUISwitch($parent, $tabitem2) $sub = GUICreate("", 370, 340, (@DesktopWidth - 1000)/ 2, (@DesktopHeight - 500) / 2, $WS_POPUP + $WS_VSCROLL, $WS_EX_MDICHILD, $parent) GUISetState(@SW_SHOW, $sub) GUICtrlCreateInput("bbbb", 25, 60, 250, 20,0x0080) GUICtrlCreateInput("cccc", 25, 90, 250, 20,0x0080) EndIf EndSelect WEnd Exit EndFunc ;==>_Main Func _SetThemes($Style) If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1) Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties") If Not IsArray($ret) Then Return SetError(1,0,-1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style) Return $ret[0] EndFunc first, I select "data" item from Template in tab report, then I click radio button Add report template, at last, I click radio button Add reports, the question appears at this moment, the two inputbox "bbbb", "cccc" are missing, In fact, the sub window is missing. I hope the controls shown, how can I do it?
-
hi, I used a sub window to solve my question. I have not used tab control, but GUI window.
-
Thanks for all, andybiochem's method suit my needs. But, I have another question, because I have had a parent tab control on the GUI window, can I add sub tab on the parent tab?
-
Hello, I need a specific container, it will be implanted into a GUI window. There is a combo in the GUI window. if I select one item from this combo, some inputbox will be shown in the specific container. if I select another itme from this combo, the original inputbox in this container will be removed, and others inputbox will be shown. I have not found a suitable GUI control, could you help me?