Leaderboard
Popular Content
Showing content with the highest reputation on 09/04/2018 in all areas
-
Bullshit... You better read those forumrules right now and adhere to them. Second account is locked. Do not do this again or else all accounts will be banned. Jos2 points
-
It doesn't affect the warning message, it prevents the function from being stripped. And you're putting the wrong function name in there. The callback function is the one you need to have AU3Stripper ignore, not the function that calls it.1 point
-
It's not just SQLite, it's any script that uses a variable to call a function.1 point
-
The process name (ProcessList) and the full path and file name from any of those macros, won't match.1 point
-
GUI for managing database
FrancescoDiMuro reacted to Melba23 for a topic
price98, And now you have the Mods' attention - would you care to explain why you share an IP with this guy, whose question seems very close to yours? And the answer had best be a good one! M23 P.S. And as it apparently needs saying over and over - everyone else keep out!!!1 point -
1 point
-
Variable must be of type "Object" Error
pixelsearch reacted to ajag for a topic
That means, that $oPreview isn't an object. You have to do some error checking when creating an object like $oPreview = ObjCreate("Preview.Preview.0") If Not @error Then MsgBox(0, "OK", "ObjCreate successful !") Else MsgBox(0, "ERROR ", "Failed to create Object. Error code: " & Hex(@error, 8)) EndIf1 point -
Try this, found in SciTE-Help:- #AutoIt3Wrapper_Run_SciTE_OutputPane_Minimized=Y ;(Y/N) Minimize SciTE output pane at run time. Default=N1 point
-
Eigen4AutoIt - Matrix computing with Eigen
argumentum reacted to RTFC for a topic
E4A Version 4.5 is released. The good news: These new features: _Eigen_WriteMatrix_ToTextFile, with five predefined formats (default: csv) and optional user-defined precision. bitmask versions of cellwise functions _Eigen_CwiseBinaryMasked, _Eigen_CwiseScalarMasked, and _Eigen_CwiseUnaryMasked, with new test script (#28). a fifth cellwise logical operation "Flip," which replaces all non-zero values within scope with zero and all zero values within scope with unity a major extension of _Eigen_LDA, now also supporting Bayesian linear and quadratic discriminant analysis Eigen includes for dlls upgraded to stable release version 3.3.5. Additional details can be found in the Changelog, as usual. The bad news: Due to compiler limitations (compilation time has mushroomed to take over fifty hours(!) per platform), the dll source has had to be completely re-organised and repartitioned, causing the final output to more or less double in size. I've unsuccessfully tried various alternative compilers and different settings, but those that download this latest version will have to live with this for now. Furthermore, this will probably be the last release for this year, as my summer break is ending soon. Nevertheless I'll do my best to keep this environment evolving when and where I can...1 point -
Or without RegEx: Func MacheHTML($string) $rot = "#ff5050" $orange = "#ff9933" $string = StringReplace($string, "STAY SHORT", "STAY S_HORT",0,1) ; Alles was orange wird $string = StringReplace($string, "STAY S_HORT", "<font color=" & $orange & ">STAY S_HORT</font>",0,1) ; Alles was rot wird $string = StringReplace($string, "SHORT", "<font color=" & $rot & ">SHORT</font>",0,1) $string = StringReplace($string, "STAY S_HORT", "STAY SHORT",0,1) Return $string EndFunc1 point
-
Hi. Take a StringRegExpReplace for the SHORT part. Use the search string „(?i)(?<!stay )short“ to only color SHORT in red but not STAY SHORT. After that you can replace STAY SHORT with the orange part. You can see the result and do some testing with the regex here: https://regex101.com/r/wCaBO4/1 Simpel P.S. If you use short and stay short in lower letters and they should not be colored then delete that (?i) part from the search string as this means searching case insensitive.1 point
-
Button to run script
caramen reacted to FrancescoDiMuro for a topic
Hi @iMacg3, and welcome to the AutoIt Forum Mainly, there are two ways to make an action when pressing a button. The first, is by using an infinite While loop, in which there's a function called GUIGetMsg(), which continuously sees if there are new "messages", like a button press, the close event of the GUI, and so on. The structure what I've described has this form: Local $idMsg = 0 While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $idButton ; Make actions when $idButton has been pressed Case $GUI_EVENT_CLOSE ; Exit the script, since the "X" button of the GUI has been pressed Exit EndSwitch WEnd The second one, is by using the option "OnEventMode = 1", which means that, the script, will not continuously sees if there are new messages, but will process them and take actions only when the event(s) effectively occur(s). The structure of what I've described has this form: Global $GUI = GUICreate() GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") Global $idButton = GUICtrlCreateButton(...) GUICtrlSetOnEvent(-1, "idButton_Click") GUISetState($hGUI, @SW_SHOW) While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func idButton_Click() ; The button has been pressed EndFunc You can find more about GUIGetMsg() and the Option OnEventMode in the Help file P.S.: If you want to make a GUI without manually calculating the position of the controls, you can use Koda Form Designer1 point -
Good reading. For a full, strict and correct explanation of a PCRE-compatible regex in verbose plain English you can use http://regex101.com/ which also offers a useful step-by-step debugging feature. Sidenote: AutoIt PCRE implementation sets \R to match LF or CR or CRLF. That can be changed at runtime (see help).1 point
-
Timestamp problem
JLogan3o13 reacted to Melba23 for a topic
Bharathit, And we have never heard that before......thread locked. M231 point -
help with bitAND, bitOR
pixelsearch reacted to SadBunny for a topic
Times HAVE changed. I grew up in a time where you actually had to ride your bicycle to the library to look up something in a book, which you in turn had to look up using some sort of enormous rolodex. Where you had to actively and secretly search for your father's porn stash (which your and your friends' fathers invariably hid behind that stack of 33 1⁄3 rpm LP records in that dusty hallway shelf ) Where it was normal to type in 20 pages of BASIC code from a magazine into your TRS-80 to play an ascii-based hangman. Where you needed to fold open a big paper map to fumble your way over an unknown road. Etc.. Right now, you just clicketyclick everything into one of your magical machines and blammo, you get everything you ask for on your billions-of-colors multimonitor setup and store it on your SSD that easily reads or writes TWO BILLION bits of data per damn second. While watching free full-hd youtube on the other monitor. And still there are many people who think even that's too much work. Until that point I agree with guiness and jchd. Laziness and expecting something-for-nothing indeed runs rampant. BUT... Many things still take a lot reading and effort to puzzle out before you're able to reach your own goal. The power of the technology grows and evolves, but so do the possibilities to use it and the goals to reach with it, and so does the veritable ocean of information you have to wade through before you get the actual information 1. applicable to your question and 2. written in just that way that hits your spot. Some people are much more capable of that wading than others, and some more people get turned off by that and give up altogether. Weakness/laziness? Perhaps, often even, but it's also often just a question of getting lost in that ocean just because it looks or feels intimidating. Different things come easily to different people. In this case, you'll notice that Kor never asked for anyone to code anything for him, and he posted the code that he tried. He has obviously already tried to use information available elsewhere. Those are the only two things that everyone clamors for on this forum when someone misforms a question. He asked for information on a very specific piece of functionality, which to me looks suspiciously much like someone who IS actually willing to learn something. So, to facilitate that, both me and Jake did our best to come up with an explanation(s) we thought could actually help. I don't understand what's so wrong with that. Sorry for the long story again. I should really go to bed. Have a nice day all1 point -
bitwise calcs
pixelsearch reacted to Melba23 for a topic
JohnOne, You are correct - it is binary. Are you sitting comfortably? Then let us begin.... First AND and OR. An AND operation is only true if BOTH elemnts have the bit set. An OR operation is true if EITHER of the elements have the bit set: 0010 AND 0111 will give 0010 because only that bit is set in BOTH 0010 OR 0111 will give 0111 because those bits are set in EITHER one of the elementsTher is also XOR, which is true only if the bits are different in each element - but we will not go there today! Look at those flags you mentioned in binary (remember we go up in powers of 2: Power of 2 7 6 5 4 3 2 1 0 Value 128 64 32 16 8 4 2 1 1 x = binary 00000001 2 x = binary 00000010 4 x = binary 00000100 ... 64 x = binary 01000000 And 44 x x x = 32 + 8 + 4 = binary 00101100So in essence you have to check whether a particulr bit is set in the number - gets complicated! But AutoIt uses the Bit* functions to help you use the decimal numbers that we (or at least some of us) are more used to dealing with. So to see if the flags 32, 8 and 4 are set we use BitAND: $iMask = 44 ; 00101100 For $i = 43 To 45 If BitAnd($i, $iTest) = $iMask Then ConsoleWrite($i & " matches!" & @CRLF) NextNote that we match both 44 and 45 as the flags are set in both cases: 43 = 00101011 = __X_X_xx = not all our flags set 44 = 00101100 = __X_XX__ = all our flags set 45 = 00101101 = __X_XX_x = all our flags set - even though there are others also set!Remember we are looking at individual bits and not the whole number. If we wanted to do that we could just use If $i = $iMask. We use BitOR to add styles for a similar reason. It makes sure that only the bits associated with that particular style are set. If we added the actual values of the styles together we could end up with a number which set the wrong bits: Style 1 = 17 = 00010001 Style 3 = 33 = 00100001 If we add we get 50: 00110010 and the flag bit are wrongly set If we BitOR we get: 00110001 and the flag bits are correctly setSee the difference? Most of the time there is not a problem - but it best to use BitOr to be sure. Is that enough to be going on with? M231 point -
Label Automatic Width (Fit Text)
Deye reacted to ResNullius for a topic
Here is an example of a function I wrote just about a week ago. It gets the text and the font used from the specified control and then resizes based on that, so should work for you after reseting font size I actually tore apart a resize section from the listview UDF and built on that. #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $Gui = GUICreate("resize label to text width") $label1 = GUICtrlCreateLabel("A label", 5, 5, 350, 15) GUICtrlSetBkColor(-1, 0x00ff00) GUICtrlSetFont(-1, 10, 400, 2, "Times New Roman") $label2 = GUICtrlCreateLabel("A big font label", 5, 30, 350) GUICtrlSetBkColor(-1, 0x00ff00) GUICtrlSetFont(-1, 12, 600, 2, "Arial") $label3 = GUICtrlCreateLabel("A label that will be padded", 5, 60, 350, 15) GUICtrlSetBkColor(-1, 0x00ff00) GUICtrlSetFont(-1, 9, 400, 2, "Times New Roman") $label4 = GUICtrlCreateLabel("A big label that will be padded", 5, 90, 350) GUICtrlSetBkColor(-1, 0x00ff00) GUICtrlSetFont(-1, 12, 600, 2, "Arial") $btn = GUICtrlCreateButton("Do it!", 175, 200) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $btn _Control_SetWidth2Text($Gui, "", $label1) _Control_SetWidth2Text($Gui, "", $label2) _Control_SetWidth2Text($Gui, "", $label3, 5);5 pixels of trailing pad _Control_SetWidth2Text($Gui, "", $label4, 25);25 pixels of trailing pad EndSwitch WEnd Func _Control_SetWidth2Text($hWin, $sWinText, $hCtrl, $iPad = 0) ;author: ResNullius, based on PaulIA/GaryFrost (listview udf) Local $hWnd, $hDC, $hFont, $iMax, $tSize, $sText, $aCtrlPos, $ctrlX, $ctrlY, $ctrlW, $ctrlH If Not IsHWnd($hCtrl) Then $hWnd = ControlGetHandle($hWin, $sWinText, $hCtrl) Else $hWnd = $hCtrl EndIf If IsHWnd($hWnd) Then $hFont = _SendMessage($hWnd, $WM_GETFONT) $hDC = _WinAPI_GetDC($hWnd) _WinAPI_SelectObject($hDC, $hFont) $sText = ControlGetText($hWin, $sWinText, $hCtrl) $tSize = _WinAPI_GetTextExtentPoint32($hDC, $sText & " ") If DllStructGetData($tSize, "X") > $iMax Then $iMax = DllStructGetData($tSize, "X") + $iPad $aCtrlPos = ControlGetPos($hWin, $sWinText, $hCtrl) $ctrlX = $aCtrlPos[0] $ctrlY = $aCtrlPos[1] $ctrlW = $aCtrlPos[2] $ctrlH = $aCtrlPos[3] ControlMove($hWin, $sWinText, $hCtrl, $ctrlX, $ctrlY, $iMax, $ctrlH) EndIf _WinAPI_SelectObject($hDC, $hFont) _WinAPI_ReleaseDC($hWnd, $hDC) EndIf EndFunc;==>_Control_SetWidth2Text1 point