Leaderboard
Popular Content
Showing content with the highest reputation on 10/24/2013 in all areas
-
CommAPI - Serial and parallel communication with Windows API
mLipok reacted to therealhanuta for a topic
In the moment there are two UDF's for serial communication: >Serial Port / COM Port UDF (needs comMG.dll) >Serial Communication using kernel32.dll The first UDF is very popular, but it has the disadvantage, that an unknown DLL needs to be used. The second UDF use the Windows API, but it has much less features. So, I decided to create an another UDF for my requirements. You can find the result here: http://www.autoitscript.com/wiki/CommAPI It is a further development of the second UDF and has (almost) all functions of the first UDF. Feel free to fix any existing bugs and to extend it with additional functions.1 point -
meaning that you want to wait on the NotePad??? if so just change the run to runwait1 point
-
Split String To Array
MadaraUchiha reacted to jdelaney for a topic
interesting, I can't reproduce that...i get an array of three arrays, each with 4 values edited to output the arrays: #include <array.au3> $string = "Info1||||Info2||||Info3||||Info4" & @CRLF & _ "Info5||||Info6||||Info7||||Info8" & @CRLF & _ "Info9||||Info10||||Info11||||Info12" ;~ ConsoleWrite($string & @CRLF) $aCRLFSplit = StringSplit($string,@CRLF,3) For $i = 0 To UBound($aCRLFSplit)-1 $aCRLFSplit[$i] = StringSplit($aCRLFSplit[$i],"||||",3) ConsoleWrite(_ArrayToString($aCRLFSplit[$i]) & @CRLF) Next where output is: Info1|Info2|Info3|Info4 Info5|Info6|Info7|Info8 Info9|Info10|Info11|Info121 point -
Split String To Array
MadaraUchiha reacted to jdelaney for a topic
here ya go...if you want an array for each line #include <array.au3> $string = "Info1||||Info2||||Info3||||Info4" & @CRLF & _ "Info5||||Info6||||Info7||||Info8" & @CRLF & _ "Info9||||Info10||||Info11||||Info12" ConsoleWrite($string) $aCRLFSplit = StringSplit($string,@CRLF,3) For $i = 0 To UBound($aCRLFSplit)-1 $aCRLFSplit[$i] = StringSplit($aCRLFSplit[$i],"||||",3) _ArrayDisplay($aCRLFSplit[$i]) Next1 point -
Split String To Array
MadaraUchiha reacted to UEZ for a topic
Try this: #include <Array.au3> $MyString = "Info1||||Info2||||Info3||||Info4" $Parts = StringSplit(StringReplace($MyString, "||||", "|"), "|", 2) _ArrayDisplay($Parts) @guinness: that will not work as expected. Br, UEZ1 point -
Country name
MadaraUchiha reacted to BrewManNH for a topic
Global Const $GEO_FRIENDLYNAME = 8 Local $ID = _WinAPI_GetUserGeoID() ConsoleWrite('Name: ' & _WinAPI_GetGeoInfo($ID, $GEO_FRIENDLYNAME) & @CRLF) Func _WinAPI_GetGeoInfo($GEOID, $iType, $iLanguage = 0) Local $Ret = DllCall('kernel32.dll', 'int', 'GetGeoInfoW', 'long', $GEOID, 'dword', $iType, 'wstr', '', 'int', 4096, _ 'word', $iLanguage) If @error Or Not $Ret[0] Then Return SetError(@error, @extended, 0) ; If Not $Ret[0] Then Return SetError(1000, 0, 0) Return $Ret[3] EndFunc ;==>_WinAPI_GetGeoInfo Func _WinAPI_GetUserGeoID() Local $Ret = DllCall('kernel32.dll', 'long', 'GetUserGeoID', 'uint', 16) If @error Then Return SetError(@error, @extended, -1) ; If $Ret[0] = -1 Then Return SetError(1000, 0, 0) Return $Ret[0] EndFunc ;==>_WinAPI_GetUserGeoID This is the 2 functions and one Constant stripped from the WinAPILocale UDF, not recommended, but at least you can see how it was done this way.1 point -
Country name
MadaraUchiha reacted to l3ill for a topic
Um.... @OSLang does exactly what you are requesting....I think? ccp from the HelpFile: MsgBox(0, "Your OS Language:", _Language()) Func _Language() Select Case StringInStr("0413 0813", @OSLang) Return "Dutch" Case StringInStr("0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) Return "English" Case StringInStr("040c 080c 0c0c 100c 140c 180c", @OSLang) Return "French" Case StringInStr("0407 0807 0c07 1007 1407", @OSLang) Return "German" Case StringInStr("0410 0810", @OSLang) Return "Italian" Case StringInStr("0414 0814", @OSLang) Return "Norwegian" Case StringInStr("0415", @OSLang) Return "Polish" Case StringInStr("0416 0816", @OSLang) Return "Portuguese" Case StringInStr("040a 080a 0c0a 100a 140a 180a 1c0a 200a 240a 280a 2c0a 300a 340a 380a 3c0a 400a 440a 480a 4c0a 500a", @OSLang) Return "Spanish" Case StringInStr("041d 081d", @OSLang) Return "Swedish" Case Else Return "Other (can't determine with @OSLang directly)" EndSelect EndFunc1 point -
String Manipulation (RegEX ??) question
michaelslamet reacted to kylomas for a topic
Hi ms, long time no talk... Try this... local $str = '[Never delete this]And this [url="http://OnlyDeleteThis.com"]and dont delete this too' ConsoleWrite(stringregexpreplace($str,'(.*)\[url=.*\](.*)','$1 $2') & @LF) kylomas edit: additional info If the pattern to delete occurs multiple times in the string then try this... local $str = '[Never delete this]And this [url="http://OnlyDeleteThis.com"]and dont delete this too' $str &= '[some more text to not delete]And this [url="http://2ND one to delete.com"]keep the end also' ConsoleWrite(stringregexpreplace($str,'\[url=[^\]]+\]',' ') & @LF)1 point -
HELP!!! built over script
13lack13lade reacted to jdelaney for a topic
JLogan3o13's is a really good idea. You can use relative paths, also (example of copying the script [named test2.au3] to c:test2.au3, when running as a compiled script FileInstall(".\test2.au3","c:\test2.au3") Oh, and it's a good idea to set the overwrite flag, and to modify the destination file to make sure it is read/writeable, or the copy over may not work: $destFile = @ScriptDir & "\" & @ScriptName & "_from_compiled.au3" If FileExists($destFile) Then FileSetAttrib($destFile,"-R") FileInstall(".\test2.au3",$destFile,1)1 point -
HELP!!! built over script
13lack13lade reacted to JLogan3o13 for a topic
You can also add the following to the top of your script in the future. That way, should you need it, you can always get a copy of the source: If StringInStr($cmdlineRaw, "/Extract") Then FileInstall("<full path to .au3 file>", @TempDir & "\Source.au3", 1) EndIf1 point -
Maybe something like this. Local $sStr = ClipGet() Local $sStr = "a title case only if a word is at start of line. or is preceding with a space." ; Title Case only if word is: 1) at Start of line OR 2) preceding with a space ConsoleWrite(Execute('"' & StringRegExpReplace($sStr, "\b([a-z])", '" & StringUpper("\1") & "') & '"') & @LF) ;Returns: A Title Case Only If A Word Is At Start Of Line. Or Is Preceding With A Space. ; Same as above but only for words > 1 character ConsoleWrite(Execute('"' & StringRegExpReplace($sStr, "\b([a-z])([a-z]+)", '" & StringUpper("\1") & "\2" & "') & '"') & @LF) ;Returns: a Title Case Only If a Word Is At Start Of Line. Or Is Preceding With a Space. ; Sentence Case ConsoleWrite(Execute('"' & StringRegExpReplace($sStr, "(\A|\.\s+)([a-z])", '" & "\1" & StringUpper("\2") & "') & '"') & @LF) ;Returns: A title case only if a word is at start of line. Or is preceding with a space.1 point
-
Asp.Net
AiniMalik reacted to Richard Robertson for a topic
Building web forms is a very different beast than building WinForms. It would probably be easier to specify what exactly you're looking for in an ASP.Net site and get pointers from there.1 point -
GUI on Top
lordofthestrings reacted to Xandy for a topic
this works for me: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> $hgui= 0 $hgui = guicreate("dialog window appears as top window when I run script", 600, 300); GUISetState(@sw_show) $done= 0 while $done== 0 $msg= GUIGetMsg() if $msg== $GUI_EVENT_CLOSE then $done= 1 WEnd did you want the window to remain as top window? $hgui = guicreate("dialog window always on top", 600, 300, 0, 0, -1, $WS_EX_TOPMOST); just swap $hgui = guicreate("dialog window appears as top window when I run script", 600, 300) with $hgui = guicreate("dialog window always on top", 600, 300, 0, 0, -1, $WS_EX_TOPMOST);1 point