PhoenixXL Posted July 25, 2012 Posted July 25, 2012 Hello I pass a Parameter to a function, I dont know how does it change Thanks for your help Code:Func Message($sPwm) ConsoleWrite($sPwm&@CR) EndFunc ConsoleWrite(Message(011000101010101011111000000001)&@CR) My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
water Posted July 25, 2012 Posted July 25, 2012 I get the following result:>Running:(3.3.8.1):C:Program Files (x86)AutoIt3autoit3.exe "C:Temptest2.au3" 9223372036854775807 0 +>10:33:40 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 1.6520 is the value returned by function Message. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
PhoenixXL Posted July 25, 2012 Author Posted July 25, 2012 no i wanted to know why 9223372036854775807 is getting printed, it should be 011000101010101011111000000001 My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
PhoenixXL Posted July 25, 2012 Author Posted July 25, 2012 well my mistake this should be the code Func Message($sPwm) ConsoleWrite($sPwm&@CR) EndFunc Message(011000101010101011111000000001) My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
water Posted July 25, 2012 Posted July 25, 2012 The parameter you pass is interpreted as a number and therefore converted to integer before being printed. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
PhoenixXL Posted July 25, 2012 Author Posted July 25, 2012 is there a way to avoid that I meant is there a way to get the result which is passed My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
water Posted July 25, 2012 Posted July 25, 2012 Pass it as a string? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
PhoenixXL Posted July 25, 2012 Author Posted July 25, 2012 yeah that way works but i want to pass it as the number format so can i carryout any sort of procedures inside the function that will return it back to the same format My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
water Posted July 25, 2012 Posted July 25, 2012 Then pass it as a string and convert it to a number and use this for your calculations: Func Message($sPwm) ConsoleWrite($sPwm & @CR) $Number = Number($sPwm) ConsoleWrite($Number & @CRLF) EndFunc ;==>Message Message("011000101010101011111000000001") My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
PhoenixXL Posted July 25, 2012 Author Posted July 25, 2012 (edited) Thanks but isnt it possible to pass it as a number only expandcollapse popup#include <String.au3> #include <C:UsersabhishekDesktopPresentationAbhishekSCriptsMathsEx.au3> ;ConsoleWrite(_BinStr(_StrBinary('hey there'))&@CR) Func Message($sPwm) ConsoleWrite($sPwm&@CR) EndFunc Message(011000101010101011111000000001) Func _StrBinary($sString) Local $Binary = "" For $i = 1 To StringLen($sString) $Binary &= _IntBinary(Asc(StringMid($sString, $i, 1))) Next Return $Binary EndFunc Func _BinStr($sBin) ConsoleWrite('Bin:'&$sBin&@CR) Local $sWidth=Ceiling(StringLen($sBin)/ 8) ConsoleWrite($sWidth&@CRLF) $sBin=StringFormat("%0"&$sWidth*8&"s", $sBin) ConsoleWrite($sBin&@CR) If IsInt(StringLen($sBin)/8)<>1 Then Return SetError(1,StringLen($sBin),-1) Local $sOffset=StringLen($sBin)/8 Local $sBinString Local $sString For $i=1 To $sOffset $sBinString=StringMid($sBin,(($i-1)*8)+1,8) ConsoleWrite($sBinString&@CRLF) $sString&=Chr(_BinInteger($sBinString)) Next ConsoleWrite('---------'&@CR) Return $sString EndFunc Func _IntBinary($sInteger) If $sInteger <= 0 Then Return SetError(1,$sInteger,-1) Local $sParameter While $sInteger> 0 $sParameter &= Mod($sInteger, 2) $sInteger = _Quotient($sInteger, 2) WEnd $sParameter = _StringOpposite($sParameter) Return StringFormat("%08s", $sParameter) EndFunc ConsoleWrite(_StrBinary('blaasdasdwad')&@CR) ConsoleWrite(Message(011000101010101011111000000001)&@CR) Func _BinInteger($in) Local $sInteger, $x, $i = 1, $aTmp = StringSplit(_StringOpposite($in), "") For $x = 1 To $aTmp[0] $sInteger += $aTmp[$x] * $i*(2^($x-1)) Next $aTmp = 0 Return StringFormat('%d', $sInteger) EndFunc Func _StringOpposite($sString) Local $sLen=StringLen($sString),$sReturn For $i=$sLen To 1 Step -1 $sReturn&=StringMid($sString,$i,1) Next Return $sReturn EndFunc Basically that is the code Since the FuncName is _BinStr therefore i want to pass the parameter as a number and not as a string Nothing More Edited July 25, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now