Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/19/2020 in all areas

  1. Guy_, Use my StringSize UDF (the link is in my sig) to break up the strings to the width you require - the UDF adds @CRLFs where necessary so solving your problem. M23
    1 point
  2. Guy_, 1. Buttons always loose a single "&" character as Windows interprets that as setting the next character as the accelerator key for firing the control - you need to double the "&" using StringReplace. 2. You can add the same spacing to the beginning of each line to create a standard margin like this: #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $sText = "This is line #1" & @CRLF & "This is line #2" _AddMargin($sText) $hGUI = GUICreate("Test", 500, 500) $cButton = GUICtrlCreateButton($sText, 10, 10, 580, 40, BitOR($BS_LEFT,$BS_MULTILINE)) GUICtrlSetFont(-1, 11, 600) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _AddMargin(ByRef $sText) $sText = " " & StringReplace($sText, @CRLF, @CRLF & " ") EndFunc 3. Never seen bitmap colours change as you describe. M23
    1 point
  3. ehrm, you say you get the error when the number is above 1000. Is the number you are capturing perhaps formatted with a decimal point (eg. "1.000" instead of "1000")? Then it would calculate 1/2 which is of course 0.5 and you'd need to remove the thousands-separator. $value = Clipget() ;Retrieve from clipbaord $value = Stringreplace($value,".", "") ; remove . $value = $value / 2 ;Divide Clipput($value) ;Store in clipboard
    1 point
  4. I assume that you meant how to calculate the gross wages since you said "1 hour = 1000 money". Use _DateDiff to calculate the number of minutes between start and end times Divide minutes by 60 to get hours Multiply hours times hourly rate to calculate gross wages #include <Constants.au3> #include <Date.au3> Const $HOURLY_RATE = 1000.00, _ $START_TIME = '2020-10-18 23:00', _ $END_TIME = '2020-10-19 06:30' Global $fHours = _DateDiff('n', $START_TIME, $END_TIME) / 60 Global $fWages = $fHours * $HOURLY_RATE MsgBox($MB_ICONINFORMATION+$MB_TOPMOST, "Wages", _ StringFormat("Start = %s\nEnd = %s\n\nHours = %.2f\nRate = %.2f\n\nWages = %.2f", _ $START_TIME, $END_TIME, $fHours, $HOURLY_RATE, $fWages))
    1 point
  5. Hi, isn“t it strange that this question is asked again and again? What have these people been working on in their lives, and what tools have been used by them? How do I have to imagine a questioner who is not able to solve the simplest problem creatively? Using the right tool to solve a problem is one of the basic components of human existence. People who use a shoe to "hammer" a nail into a wall use possibly the wrong tool, but they DO something to solve the problem by themselves. People who ask in a internet forum "is a shoe the right tool to put a nail into a wall?" do NOTHING. They leave other people to find a solution. Creative? No. Will they ever become a good craftsman or programmer? EVER? No... Writing computer programs to solve problems is (most of the time) a very creative, exhausting and demanding process. For some of us it is fun most of the time, sometimes it is really hard work. We have to use MANY tools every single day, and yes, we often use "wrong" tools, but we DO everything to solve the actual problem. If we find a better tool, we use it instead. But the question of "usefulness"? The answer to the question "AutoIT as main programming language: is it useful enough?" is only "YES" or "NO". Depending only to the personal experience of the answering people. But....is "I have (not) the experience to solve a computer problem with this language!" the answer which helps the OP in any way? And does this answer helps other people who find this thread? Will this answer make them DO something? Is this thread "useful"? If the question would be "Which programming language/UDF/API/Script/Snippet/Function/Framework/Library/Method/Object/Class/techniqe.... do YOU (as a experienced programmer) recommend to solve THIS/MY (described below) problem?", then the "experienced" (or not) programmer could give a (more or less) helpful answer. And possibly show a nice Autoit script. Or refer to other "useful" programming languages like ....(placeholder for ANY programming language). Yes, ANY! I am sure that people asking for "usefulness" of a programming language are not able to program. I'm not even sure if they'll ever DO anything "useful".... And with a little hope that this post is not completely "useless", a following link: http://www.catb.org/~esr/faqs/smart-questions.html
    1 point
  6. 1 point
  7. Melba23

    @ScriptDir

    MasonMill, There is no file - @ScriptDir is a macro generated at runtime. M23
    1 point
×
×
  • Create New...