Jump to content

enigmaforceiv

Active Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by enigmaforceiv

  1. I'm trying to learn the best I can in the small amount of time that I got to "complete" this project. I'm not just taking bits of info and slapping it together in the official script; instead, I am analyzing and cross-referencing each command for a better understanding of what that command does. I wish not for people to help me by giving me an entire working script that can simply be copied and pasted, but for just a simple explanation or guidance. In this case, figuring out what "&" does, and why the script is considering that it's badly formatted.
  2. I'm getting an error saying "Badly formatted "Func" statement) at the first "&" after the "$dastination".
  3. The only problem I'm having is setting it to list the files rather than the folders.
  4. #region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <AVIConstants.au3> #include "RecFileListToArray.au3" Global $font = "Arial" Global $GUI_BGC = "0x5F0505" ;============================================================================= Opt("GuiOnEventMode", 1) Opt("GUICoordMode", 3) ;============================================================================= $GUI = GUICreate("C21 Chicago's Finest ~ Let's Take This Journey... Together.", 800, 600) ; creates window GUICtrlCreatePic("logo4.jpg", 0, 0, 800, 115) GUICtrlCreateMenu("File") GUICtrlCreateMenu("About") GUICtrlCreateMenu("Logout") GUISetBkColor($GUI_BGC) GUISetFont(9, 400, 0, $font) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $FileViewer = GUICtrlCreateList("", 400, 142, 375, 175) $BuyerV = GUICtrlCreateTabItem("Buyers") ;creates item in tab $Blist = GUICtrlCreateList("", 195, 143, 175, 180);creates list in the above tab Buyers() ;calls function ;FUNCTIONS HERE PLEASE ----- Begin Tabbed Items Function Func Buyers() $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseBuyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($Blist, $folder) Next In the $Blist, I notice that whenever I select a folder, it becomes highlighted. However, what I want to do is make that selection output its subfiles into the $FileViewer. How would I do that?
  5. Updated, sorry was at that "point" of knocking out trying to figure out this new issue! haha
  6. I would like to change the font color of a GUICtrlCreateLabel from default black into another color - the problem I'm having is that I don't want it to be the global text color, instead, I want it to pertain just to the specific text.
  7. Somewhat, is that possible but while using the list that "GUICtrlCreateList" creates?
  8. I was wondering if it is possible to make the List and its items clickable? Currently, my program lists Folders, and I want to be able to click the Folders and list its contents. Will I need another script to do this? Forgive me for my ignorance - I think I came across a similar thread, but lost it!
  9. #region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include "RecFileListToArray.au3" Global $font = "Arial" Global $GUI_BGC = "0x660000" $GUI = GUICreate("C21 Chicago's Finest", 800, 600) ; creates window GUISetBkColor($GUI_BGC) Opt("GuiOnEventMode", 1) $BuyerV = GUICtrlCreateButton("Buyers", 50, 50, 100, 30) ;creates buttons $BEvent = GUICtrlSetOnEvent($BuyerV, "Buyers") ;assigns event to button $SellerV = GUICtrlCreateButton("Sellers", 50, 100, 100, 30) $SEvent = GUICtrlSetOnEvent($SellerV, "Sellers") $RenterV = GUICtrlCreateButton("Renters", 50, 150, 100, 30) $REvent = GuiCtrlSetOnEvent($RenterV, "Renters") $list = GUICtrlCreateList("", 200, 50, 300, 290) GUISetState() While 1 Sleep(1000) ;less cpu WEnd Func Buyers() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseBuyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc Func Sellers() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseSellers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc Func Renters() GUICtrlSetData($list, "") Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseRentals", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I'm having problems getting my script to close, it worked before (I hadn't had much of the code in there as I do now), and ever since I've been updating the script - it suddenly stopped allowing me to exit. I now have to end task through the task manager.
  10. Wow, that loop saved up so much cpu! Thanks for all your help guys, everything is working as expected now!
  11. Do you think a loop will be necessary? $BuyerV = GUICtrlCreateButton("Buyers", 50, 50, 100, 30) ;creates buttons $BEvent = GUICtrlSetOnEvent($BuyerV, "Buyers") ;assigns event to button $list = GUICtrlCreateList("", 200, 50, 300, 290) ;creates a universal list window - however all files are displayed here instead of erased. GUICtrlSetData($list, "") GUISetState(@SW_SHOW) Func Buyers() Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:DropboxCentury21Client DatabaseBuyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc
  12. I'm guessing that my problem isn't an If/then statement, but more of a question on how can I turn "on and off" a command in my script. Generally, what I'm trying to do is have the button call a function that lists files in a specific directory. However, instead of listing files in each directory separately, it adds to the list of already found files. What I'm trying to do is have that list "refresh" into the new list.
  13. Then the IF/Then statements aren't needed, correct?
  14. Thanks all! Also, $BEvent is tied to a button, however, even though I don't press the button to call the function, the function is already executed - even though I didn't click any buttons. How can I tell the script to not execute a function unless it's called on?
  15. If $BEvent = 1 Then Func Buyers() Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(10) $FileList = _FileListToArray("C:\Dropbox\Century21\Client Database\Buyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndIf EndFunc I keep getting this error: "Func Buyers() Error: "If" statement has no matching "EndIf" statement." What am I doing wrong?
  16. Can one of you explain how this works on the user's side? Do they click to choose the file that they want to delete? I'm looking to do something similar, but would like the event to open the directory and its contents within.
  17. I'm trying to get my buttons to call up their functions and list them. However, it wont return any information to the list. #region #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Tidy_Stop_OnError=n #endregion #include #include #include #include #include #include #include "RecFileListToArray.au3" Global $font = "Arial" Global $GUI_BGC = "0xf0ffff" $GUI = GUICreate("C21 Chicago's Finest", 800, 600) ; creates window GUISetBkColor($GUI_BGC) $BuyerV = GUICtrlCreateButton("Buyers", 50, 50, 100, 30) GUICtrlSetOnEvent($BuyerV, "Buyers") $SellerV = GUICtrlCreateButton("Sellers", 50, 100, 100, 30) GUICtrlSetOnEvent($SellerV, "Sellers") $RenterV = GUICtrlCreateButton("Renters", 50, 150, 100, 30) GUICtrlSetOnEvent($RenterV, "Renters") $list = GUICtrlCreateList("", 200, 50, 300, 290);WANT EVERYTHING TO BE SHOWN IN THIS LIST ;BASED ON BUTTON CLICKED / WANT TO CALL THE FUNCTION BASED ON THE BUTTONS CLICKED GUISetState(@SW_SHOW) Func Buyers() Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(1000) $FileList = _FileListToArray("C:\Dropbox\Century21\Client Database\Buyers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc Func Sellers() Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(1000) $FileList = _FileListToArray("C:\Dropbox\Century21\Client Database\Sellers", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc Func Renters() Opt("GUICoordMode", 3) GUISetFont(9, 1000, 0, $font) Sleep(1000) $FileList = _FileListToArray("C:\Dropbox\Century21\Client Database\Rentals", "*", 2) ; get only folders with the quoted string _ArrayDelete($FileList, 0) ; Throwing out the total folder count from the 0 index For $folder In $FileList ; Loop over folders found. GUICtrlSetData($list, $folder) Next EndFunc GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd If I decided to add the functions: "Buyers(), Seller(), Renter()" it would display the files in one who chunk - what am I doing wrong?
  18. May I ask why only 1 and 3 show in your coding, Melba?
  19. Perfect! The only problem is that the Array gives me another window (Like a spreadsheet) - after closing it, the files appear in the window. Removed _ArrayDisplay and now works perfectly! Thanks again.
  20. I'm going on day 2 trying to figure this out, deciding to ask for some help. I'm trying to list files (that are clickable) within a directory in the GUI tab object, but haven't been successful. I am able to get the list of files, which show up before the GUI is launched. I am currently using Array.au3 and File.au3 to do this. What I want is the files to appear within the tab windows of the tabbed items... if that makes sense. Any advice? Here is my code: #include <GUIConstantsEx.au3> #include <Array.au3> #include <File.au3> #include "RecFileListToArray.au3" _Main() Func _Main() Local $Buyers = _ArrayDisplay("C:DropboxCentury21Client DatabaseBuyers") ; Variable is assigned to list the files and folders GUICreate("C21 Chicago's Finest", 800, 600) ; creates window GUICtrlCreateTab(50, 50, 700, 300) GUICtrlCreateTabItem("Buyers") GUICtrlCreateList((_FileListToArray($Buyers)), 50, 70, 699, 313) EndFunc GUISetState () While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  21. I've looked in the help file and failed to find the "Array.au3", do you know where else I might get it?
×
×
  • Create New...