Jump to content

jiglei

Active Members
  • Posts

    62
  • Joined

  • Last visited

jiglei's Achievements

Wayfarer

Wayfarer (2/7)

2

Reputation

  1. I just typically installed autoit... guess I'll install it again, I think I've included old versions by mistake when importing my includes... Sorry about the mess that I've made, and thank you for the help. EDIT: Reinstall solve the problem, pardon me for my noobiness.
  2. Hello, thanks for looking into the issue, I ran the same code and it returns this : >Running AU3Check (3.3.12.0) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\David\Documents\AutoIT\Test.au3 +>20:16:52 AU3Check ended.rc:0 >Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\David\Documents\AutoIT\Test.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop 29/12/14 - Week: 53 - error: 0 04/01/15 - Week: 0 - error: 0 +>20:16:52 AutoIt3.exe ended.rc:0 +>20:16:52 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.872 Ever since I've made a PC refresh on my system, and reinstalled the autoit packages, some built-in functions have been working weirdly for me, don't know if I have the wrong date.au3 or is it system related? Could the time format of my PC influence the result? For what I've looked into the function, it shouldn't. This is the code of the function that I have: ; #FUNCTION# ==================================================================================================================== ; Name...........: _WeekNumberISO ; Description ...: Calculate the weeknumber of a given date. ; Syntax.........: _WeekNumberISO([$iYear = @YEAR[, $iMonth = @MON[, $iDay = @MDAY]]]) ; Parameters ....: $iYear - Year value (default = current year) ; $iMonth - Month value (default = current month) ; $iDay - Day value (default = current day) ; Return values .: Success - Returns week number of given date ; Failure - 0 ; @Error - 0 - No error. ; | 1 - faulty parameters values ; |99 - On non-acceptable weekstart value ; Author ........: Tuape ; Modified.......: JdeB: modified to UDF standards & Doc., Change calculation logic. ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _WeekNumberISO($iYear = @YEAR, $iMonth = @MON, $iDay = @MDAY) ; Check for erroneous input in $Day, $Month & $Year If $iDay > 31 Or $iDay < 1 Then Return SetError(1, 0, -1) ElseIf $iMonth > 12 Or $iMonth < 1 Then Return SetError(1, 0, -1) ElseIf $iYear < 1 Or $iYear > 2999 Then Return SetError(1, 0, -1) EndIf Local $idow = _DateToDayOfWeekISO($iYear, $iMonth, $iDay); Local $iDow0101 = _DateToDayOfWeekISO($iYear, 1, 1); If ($iMonth = 1 And 3 < $iDow0101 And $iDow0101 < 7 - ($iDay - 1)) Then ;days before week 1 of the current year have the same week number as ;the last day of the last week of the previous year $idow = $iDow0101 - 1; $iDow0101 = _DateToDayOfWeekISO($iYear - 1, 1, 1); $iMonth = 12 $iDay = 31 $iYear = $iYear - 1 ElseIf ($iMonth = 12 And 30 - ($iDay - 1) < _DateToDayOfWeekISO($iYear + 1, 1, 1) And _DateToDayOfWeekISO($iYear + 1, 1, 1) < 4) Then ; days after the last week of the current year have the same week number as ; the first day of the next year, (i.e. 1) Return 1; EndIf Return Int((_DateToDayOfWeekISO($iYear, 1, 1) < 4) + 4 * ($iMonth - 1) + (2 * ($iMonth - 1) + ($iDay - 1) + $iDow0101 - $idow + 6) * 36 / 256) EndFunc ;==>_WeekNumberISO
  3. Hello everyone, I think I just noticed a problem in the UDFs included in autoIT's beta version, more precisely the _WeekNumberISO() function. I've been checking how the ISO week system works, and this UDF doesn't seem to always be returning the correct values. I've searched and found an old topic about this issue that was closed and declared fixed the problem, which was exactly the same in 2003-2004, but it doesn't seem fixed now. For instances, if you were to return the week number of 29 December 2014 (Monday), it returns week 53, which is wrong, because acording to the ISO 8601 dating system, the first week of the year is the one that includes the first thursday. And for some wicked reason, if you try to return the week number of January 4th 2015, it returns week number 0 with @error=0. Another ISO rule is that the January 4th must always belong to the week number 1, so, there's something wrong with that. I've been looking to the code, I'm not gonna promisse to try to fix it because I'm too inexperienced, and I might be wrong, and wanted to know what are your thoughts on this. Also, this site agrees: http://www.epochconverter.com/date-and-time/weeknumbers-by-year.php
  4. Why are you using this UDF when there's now a native function in autoit that does the same? AdlibRegister() and AdlibUnRegister(). Try those.
  5. Sounds weird, I used to work a while with all those functions and never happened to me, perhaps if you show your script we can take a look to what might be going wrong.
  6. Hey guys, I was searching the forums on how would I be able to make my program the "defined program" to run a certain type of files that I myself made, and make those type of files have a right icon, and not a crappy one that windows sets to it. I managed to find in some topic refering to the FAQ here, I looked it up and I actually found exactly what I needed at question 16. Now here's the thing, I can't get the source of the function without getting the source of "<FileRegister.au3>", I tried to download it but the following error showed up in a forum message: [#10171] You do not have permission to view this attachment. I thought it happened because I wasn't logged on to the forum, but I tried to relog twice, and even though it says I'm logged, it stills says I'm not authorized. I don't know why I'm not authorized, and can't begin to think where to search why this is happening so, maybe someone can tell me... Does it have anything to do with the warn status? No offense, but I believe it was ages ago...
  7. Found a workaround on my own. Thanks, you may close the topic.
  8. Well then, you coulid instead use the second script to delete the files, and the first one to update the progress. You can transfer the filenames or folder using INI saving, or even by running the program with commands, telling which files to delete. To your ideia of running a transparent window over the other one, i have a similiar post on to do something like that, also about a progress bar, on a UDF im building. If I had the answer to that question that could be useful to you :|
  9. You can make the second script have the GUI Window with the progress, I guess. It's just an ideia to make it simple.
  10. Bump, I need help specialy on this: If $ilabel <> 0 Or $ilabel <> "" Then ;If the user choses to create a label... ;I need to know why is this gui not becoming visible $ProgressLabels[6] = GUICreate("", $iWidth, $iHeight, $iLeft, $iTop, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $HWDGUI);Creates a transparent GUI to hold the label GUISetBkColor($ilabelColor + 500, $ProgressLabels[6]) $ProgressLabels[7] = GUICtrlCreateLabel($ilabel, 0, 0, $iWidth, $iHeight, $SS_Center);Create the label centered within the progress GUICtrlSetBkColor($ProgressLabels[7], $ilabelColor + 500) GUICtrlSetColor($ProgressLabels[6], $ilabelColor);Colors the text on the label according to the specification GUISetState(@SW_SHOW, $ProgressLabels[6]) Thanks in advance, and special thanks to AdmiralAlkex for the example above.
  11. No, I had no ideia Thanks a lot, that does help. But I'd still like to finish my UDF anyways :S. I was going to add gradient colors support too
  12. Hey guys, I managed to do a UDF that allows you to design progress bars, with the colors you want to, which is useful for who doesn't use Windows Classic theme, and still want to color those progresses. I found some skin GUI's UDF's that would work, but, I figured doing my own would be simple. I was also planning on doing more functions for this UDF, like re-setting the values and even colors, but, I got stuck at one part... To this UDF, I had an idea to also add a label, directly on the middle of the bar, since the a label there would print the background color of itself over the progress bar, I thought if I did a transparent gui right over the bar, and make the label background the same color the gui, that should do it transparent too. But, for some reason, the child window does not appear... I read on the Helpfile about the details on $WS_EX_LAYERED: " $WS_EX_LAYERED Creates a layered window. Note that this cannot be used for child windows. " But, right down on the example script, there's an example on how to do a child window transparent lol. example2() Func Example2() Local $gui, $background, $pic, $basti_stay, $msg Local $sFile = "..\GUI\logo4.gif" $gui = GUICreate("Background", 400, 100) ; background picture $background = GUICtrlCreatePic("..\GUI\msoobe.jpg", 0, 0, 400, 100) GUISetState(@SW_SHOW) ; transparent MDI child window $pic = GUICreate("", 169, 68, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui) ; transparent pic $basti_stay = GUICtrlCreatePic($sFile, 0, 0, 169, 68) GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE I've also tried other guis to become transparent with images and text on a child window. But, for some damn reason, on my UDF, it doesn't work! Can someone give me a hand? I'm driving nuts over this issue... Here's my UDF as it is now: ; #FUNCTION# ================================================================================================================================================================================================================== ; Name...........: _SMTF_CreateProgress ; Description ...: Encrypts data ; Syntax.........: _SMTF_CreateProgress ($HWDGUI, $iLeft, $iTop, $iWidth, $iHeight,$iBarColor,$iBKColor [, [$ilabel=0, $iState=0, [$iBorder=1, [$iBorderColor=0x000000) ; Parameters ....: $HWDGUI -> Handle of the GUI where to create the progress. If "" then the last one will be applied ; $iLeft -> The left coordinate position of the progress ; $iTop -> The top coordinate position of the progress ; $iWidth -> The width of the progress ; $iHeight -> The height of the progress ; $iBarColor -> The initial Bar color ; $iBKColor -> The initial Background color of the progress ; $iState -> The initial percentage (%) of the progress. Default is 0 ; $ilabel -> Optional, a label centered within the progress. If this is 1, then the % of the bar will be shown, else, the text. If zero, no label will be created ; $ilabelColor -> The color of the text on the optional label, the default is black text ; $iBorder -> The initial border width. Default is 1 pixel. Bigger size may not work ; $iBorderColor -> The initial border color. Default is black (0x000000) ; Requirement(s).: v3.3.6.0 or higher ; Return values .: Success - Returns a one dimension array corresponding to the handles of the labels designing the progress. Following the protocol: ; Array[0] = The handle for the label designing the left border ; Array[1] = The handle for the label designing the top border ; Array[2] = The handle for the label designing the right border ; Array[3] = The handle for the label designing the bottom border ; Array[4] = The handle for the label designing the background of the bar ; Array[5] = The handle for the label designing the bar itself ; Array[6] = The handle for the transparent GUI where the label is ; Array[7] = The handle for the label that is over the bar. If it isn't created then this value will be zero. ; ; Failure - Returns the following errors under the ocasions: ; -1 - The given GUI Handle points to a window that does not exist. ; 0 - One of the parameters is invalid. ; Remarks .......; None ; Author ........: Mike The Fox ; Example........; No ;========================================================================================================================================================================================================================================== Func _SMTF_CreateProgress(ByRef $HWDGUI, $iLeft, $iTop, $iWidth, $iHeight, $iBarColor, $iBKColor, $iState = 0, $ilabel = 0, $ilabelColor = 0x000000, $iBorder = 1, $iBorderColor = 0x000000) Local $ProgressLabels[8], $n If $HWDGUI <> "" Then ;If Handle is different from "" switch the gui If WinExists($HWDGUI) = 0 Then Return -1 ; Return -1 in case the window doesn't exist GUISwitch($HWDGUI) ;Switching GUI EndIf If $iLeft = "" Or $iTop = "" Or $iWidth = "" Or $iHeight = "" Or $iBarColor = "" Or $iBKColor = "" Then Return 0 $ProgressLabels[0] = GUICtrlCreateLabel("", $iLeft, $iTop, $iBorder, $iHeight);Create left border $ProgressLabels[1] = GUICtrlCreateLabel("", $iLeft, $iTop, $iWidth, $iBorder);Create top border $ProgressLabels[2] = GUICtrlCreateLabel("", $iLeft + $iWidth, $iTop, $iBorder, $iHeight + $iBorder);Create right border $ProgressLabels[3] = GUICtrlCreateLabel("", $iLeft, $iTop + $iHeight, $iWidth, $iBorder);Create bottom border For $n = 0 To 3 GUICtrlSetBkColor($ProgressLabels[$n], $iBorderColor);Coloring the Borders Next $ProgressLabels[4] = GUICtrlCreateLabel("", $iLeft + $iBorder, $iTop + $iBorder, $iWidth - $iBorder, $iHeight - $iBorder);Create progress background GUICtrlSetBkColor($ProgressLabels[4], $iBKColor);Coloring the background $ProgressLabels[5] = GUICtrlCreateLabel("", $iLeft + $iBorder, $iTop + $iBorder, ($iWidth - $iBorder) * ($iState / 100), $iHeight - $iBorder);Create the bar GUICtrlSetBkColor($ProgressLabels[5], $iBarColor);Coloring the bar If $ilabel <> 0 Or $ilabel <> "" Then ;If the user choses to create a label... $ProgressLabels[6] = GUICreate("", $iWidth, $iHeight, $iLeft, $iTop, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $HWDGUI);Creates a transparent GUI to hold the label GUISetBkColor($ilabelColor + 500, $ProgressLabels[6]) $ProgressLabels[7] = GUICtrlCreateLabel($ilabel, 0, 0, $iWidth, $iHeight, $SS_Center);Create the label centered within the progress GUICtrlSetBkColor($ProgressLabels[7], $ilabelColor + 500) GUICtrlSetColor($ProgressLabels[6], $ilabelColor);Colors the text on the label according to the specification GUISetState(@SW_SHOW, $ProgressLabels[6]) Else ;If not... $ProgressLabels[6] = 0 ;This handle shall be zero $ProgressLabels[7] = 0 ;And this too EndIf Return $ProgressLabels ;Returns the array EndFunc ;==>_SMTF_CreateProgress Thanks in advance.
  13. Search for IniRead() and IniWrite() functions. Your code seems to be too much CPU Invasive. Try something like this: ;GUI HERE ;IniRead() Section of your script While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Input1 ;If user types in $Input1, it will save to a file of your choice. IniWrite("Your file","A section","A key","What to write") ; Case other thing, I think you got it :) EndSwitch WEnd
  14. I don't exactly know what you're intending to do, but I somehow suffered for a similiar issue, and solved it by first deleting all the lines of the list view, and then it will replace them instead of doubling them. For your file, try to use FileOpen() on replacing mode, rather than just append to the end of the file. That should do it too.
×
×
  • Create New...