guinness Posted March 14, 2012 Share Posted March 14, 2012 (edited) Here is a UDF I came up with to convert various temperatures to different units for example Celsius to Fahrenheit.Any suggestions or questions then please post below. Thanks.Note: I will probably add more units over time depending on whether or not I see it is worth it.UDF:expandcollapse popup#include-once ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ; #INDEX# ======================================================================================================================= ; Title .........: Temperature ; AutoIt Version : v3.2.2.0 or higher ; Language ......: English ; Description ...: Convert various temperatures to different units for example Celsius to Fahrenheit. ; Note ..........: ; Author(s) .....: guinness, with Reaumur functions kindly provided by Andreik. ; Remarks .......: Wikipedia was used for the conversion formulas: https://en.wikipedia.org/wiki/Temperature_conversion_formulas ; =============================================================================================================================== ; #INCLUDES# ========================================================================================================= ; None ; #GLOBAL VARIABLES# ================================================================================================= ; None ; #CURRENT# ===================================================================================================================== ; _CelsiusToFahrenheit: Convert a temperature in Celsius to Fahrenheit. ; _CelsiusToKelvin: Convert a temperature in Celsius to Kelvin. ; _CelsiusToRankine: Convert a temperature in Celsius to Rankine. ; _CelsiusToReaumur: Convert a temperature in Celsius to Reaumur. ; _FahrenheitToCelsius: Convert a temperature in Fahrenheit to Celsius. ; _FahrenheitToKelvin: Convert a temperature in Fahrenheit to Kelvin. ; _FahrenheitToRankine: Convert a temperature in Fahrenheit to Rankine. ; _FahrenheitToReaumur: Convert a temperature in Fahrenheit to Reaumur. ; _KelvinToCelsius: Convert a temperature in Kelvin to Celsius. ; _KelvinToFahrenheit: Convert a temperature in Kelvin to Fahrenheit. ; _KelvinToRankine: Convert a temperature in Kelvin to Rankine. ; _KelvinToReaumur: Convert a temperature in Kelvin to Reaumur. ; _RankineToCelsius: Convert a temperature in Rankine to Celsius. ; _RankineToFahrenheit: Convert a temperature in Rankine to Fahrenheit. ; _RankineToKelvin: Convert a temperature in Rankine to Kelvin. ; _RankineToReaumur: Convert a temperature in Rankine to Reaumur. ; _ReaumurToCelsius: Convert a temperature in Reaumur to Celsius. ; _ReaumurToFahrenheit: Convert a temperature in Reaumur to Fahrenheit. ; _ReaumurToKelvin: Convert a temperature in Reaumur to Kelvin. ; _ReaumurToRankine: Convert a temperature in Reaumur to Rankine. ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ; None ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name ..........: _CelsiusToFahrenheit ; Description ...: Convert a temperature in Celsius to Fahrenheit. ; Syntax ........: _CelsiusToFahrenheit($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Celsius ; Example .......: Yes ; =============================================================================================================================== Func _CelsiusToFahrenheit($iTemperature) Return $iTemperature * (9 / 5) + 32 EndFunc ;==>_CelsiusToFahrenheit ; #FUNCTION# ==================================================================================================================== ; Name ..........: _CelsiusToKelvin ; Description ...: Convert a temperature in Celsius to Kelvin. ; Syntax ........: _CelsiusToKelvin($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Celsius ; Example .......: Yes ; =============================================================================================================================== Func _CelsiusToKelvin($iTemperature) Return $iTemperature + 273.15 EndFunc ;==>_CelsiusToKelvin ; #FUNCTION# ==================================================================================================================== ; Name ..........: _CelsiusToRankine ; Description ...: Convert a temperature in Celsius to Rankine. ; Syntax ........: _CelsiusToRankine($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Celsius ; Example .......: Yes ; =============================================================================================================================== Func _CelsiusToRankine($iTemperature) Return ($iTemperature + 273.15) * (9 / 5) EndFunc ;==>_CelsiusToRankine ; #FUNCTION# ==================================================================================================================== ; Name ..........: _CelsiusToReaumur ; Description ...: Convert a temperature in Celsius to Reaumur. ; Syntax ........: _CelsiusToReaumur($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Celsius ; Example .......: Yes ; =============================================================================================================================== Func _CelsiusToReaumur($iTemperature) Return $iTemperature * (4 / 5) EndFunc ;==>_CelsiusToReaumur ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FahrenheitToCelsius ; Description ...: Convert a temperature in Fahrenheit to Celsius. ; Syntax ........: _FahrenheitToCelsius($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Fahrenheit ; Example .......: Yes ; =============================================================================================================================== Func _FahrenheitToCelsius($iTemperature) Return ($iTemperature - 32) * (5 / 9) EndFunc ;==>_FahrenheitToCelsius ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FahrenheitToKelvin ; Description ...: Convert a temperature in Fahrenheit to Kelvin. ; Syntax ........: _FahrenheitToKelvin($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Fahrenheit ; Example .......: Yes ; =============================================================================================================================== Func _FahrenheitToKelvin($iTemperature) Return ($iTemperature + 459.67) * (5 / 9) EndFunc ;==>_FahrenheitToKelvin ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FahrenheitToRankine ; Description ...: Convert a temperature in Fahrenheit to Rankine. ; Syntax ........: _FahrenheitToRankine($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Fahrenheit ; Example .......: Yes ; =============================================================================================================================== Func _FahrenheitToRankine($iTemperature) Return $iTemperature + 459.67 EndFunc ;==>_FahrenheitToRankine ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FahrenheitToReaumur ; Description ...: Convert a temperature in Fahrenheit to Reaumur. ; Syntax ........: _FahrenheitToReaumur($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Fahrenheit ; Example .......: Yes ; =============================================================================================================================== Func _FahrenheitToReaumur($iTemperature) Return ($iTemperature - 32) * (4 / 9) EndFunc ;==>_FahrenheitToReaumur ; #FUNCTION# ==================================================================================================================== ; Name ..........: _KelvinToCelsius ; Description ...: Convert a temperature in Kelvin to Celsius. ; Syntax ........: _KelvinToCelsius($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Kelvin ; Example .......: Yes ; =============================================================================================================================== Func _KelvinToCelsius($iTemperature) Return $iTemperature - 273.15 EndFunc ;==>_KelvinToCelsius ; #FUNCTION# ==================================================================================================================== ; Name ..........: _KelvinToFahrenheit ; Description ...: Convert a temperature in Kelvin to Fahrenheit. ; Syntax ........: _KelvinToFahrenheit($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Kelvin ; Example .......: Yes ; =============================================================================================================================== Func _KelvinToFahrenheit($iTemperature) Return ($iTemperature * (9 / 5)) - 459.67 EndFunc ;==>_KelvinToFahrenheit ; #FUNCTION# ==================================================================================================================== ; Name ..........: _KelvinToRankine ; Description ...: Convert a temperature in Kelvin to Rankine. ; Syntax ........: _KelvinToRankine($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Kelvin ; Example .......: Yes ; =============================================================================================================================== Func _KelvinToRankine($iTemperature) Return $iTemperature * (9 / 5) EndFunc ;==>_KelvinToRankine ; #FUNCTION# ==================================================================================================================== ; Name ..........: _KelvinToReaumur ; Description ...: Convert a temperature in Kelvin to Reaumur. ; Syntax ........: _KelvinToReaumur($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Kelvin ; Example .......: Yes ; =============================================================================================================================== Func _KelvinToReaumur($iTemperature) Return ($iTemperature - 273.15) * (4 / 5) EndFunc ;==>_KelvinToReaumur ; #FUNCTION# ==================================================================================================================== ; Name ..........: _RankineToCelsius ; Description ...: Convert a temperature in Rankine to Celsius. ; Syntax ........: _RankineToCelsius($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Rankine ; Example .......: Yes ; =============================================================================================================================== Func _RankineToCelsius($iTemperature) Return ($iTemperature - 491.67) * (5 / 9) EndFunc ;==>_RankineToCelsius ; #FUNCTION# ==================================================================================================================== ; Name ..........: _RankineToFahrenheit ; Description ...: Convert a temperature in Rankine to Fahrenheit. ; Syntax ........: _RankineToFahrenheit($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Rankine ; Example .......: Yes ; =============================================================================================================================== Func _RankineToFahrenheit($iTemperature) Return $iTemperature - 459.67 EndFunc ;==>_RankineToFahrenheit ; #FUNCTION# ==================================================================================================================== ; Name ..........: _RankineToKelvin ; Description ...: Convert a temperature in Rankine to Kelvin. ; Syntax ........: _RankineToKelvin($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Rankine ; Example .......: Yes ; =============================================================================================================================== Func _RankineToKelvin($iTemperature) Return $iTemperature * (5 / 9) EndFunc ;==>_RankineToKelvin ; #FUNCTION# ==================================================================================================================== ; Name ..........: _RankineToReaumur ; Description ...: Convert a temperature in Rankine to Reaumur. ; Syntax ........: _RankineToReaumur($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness ; Link ..........: https://en.wikipedia.org/wiki/Rankine ; Example .......: Yes ; =============================================================================================================================== Func _RankineToReaumur($iTemperature) Return ($iTemperature - 491.67) * (4 / 9) EndFunc ;==>_RankineToReaumur ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ReaumurToCelsius ; Description ...: Convert a temperature in Reaumur to Celsius. ; Syntax ........: _ReaumurToCelsius($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness & Andreik ; Link ..........: https://en.wikipedia.org/wiki/Réaumur_scale ; Example .......: Yes ; =============================================================================================================================== Func _ReaumurToCelsius($iTemperature) Return $iTemperature * (5 / 4) EndFunc ;==>_ReaumurToCelsius ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ReaumurToFahrenheit ; Description ...: Convert a temperature in Reaumur to Fahrenheit. ; Syntax ........: _ReaumurToFahrenheit($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness & Andreik ; Link ..........: https://en.wikipedia.org/wiki/Réaumur_scale ; Example .......: Yes ; =============================================================================================================================== Func _ReaumurToFahrenheit($iTemperature) Return $iTemperature * (9 / 4) + 32 EndFunc ;==>_ReaumurToFahrenheit ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ReaumurToKelvin ; Description ...: Convert a temperature in Reaumur to Kelvin. ; Syntax ........: _ReaumurToKelvin($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness & Andreik ; Link ..........: https://en.wikipedia.org/wiki/Réaumur_scale ; Example .......: Yes ; =============================================================================================================================== Func _ReaumurToKelvin($iTemperature) Return $iTemperature * (5 / 4) + 273.15 EndFunc ;==>_ReaumurToKelvin ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ReaumurToRankine ; Description ...: Convert a temperature in Reaumur to Rankine. ; Syntax ........: _ReaumurToRankine($iTemperature) ; Parameters ....: $iTemperature - An integer value. ; Return values .: Converted temperature. ; Author ........: guinness & Andreik ; Link ..........: https://en.wikipedia.org/wiki/Réaumur_scale ; Example .......: Yes ; =============================================================================================================================== Func _ReaumurToRankine($iTemperature) Return $iTemperature * (9 / 4) + 491.67 EndFunc ;==>_ReaumurToRankineExample 1:#include 'Temperature.au3' Example() Func Example() ConsoleWrite('_CelsiusToFahrenheit: ' & _CelsiusToFahrenheit(0) & ChrW(176) & 'F' & @CRLF) ConsoleWrite('_CelsiusToKelvin: ' & _CelsiusToKelvin(0) & 'K' & @CRLF) ConsoleWrite('_CelsiusToRankine: ' & _CelsiusToRankine(0) & ChrW(176) & 'R' & @CRLF) ConsoleWrite('_CelsiusToReaumur: ' & _CelsiusToReaumur(0) & ChrW(176) & 'Re' & @CRLF & @CRLF) ConsoleWrite('_FahrenheitToCelsius: ' & _FahrenheitToCelsius(32) & ChrW(176) & 'C' & @CRLF) ConsoleWrite('_FahrenheitToKelvin: ' & _FahrenheitToKelvin(32) & 'K' & @CRLF) ConsoleWrite('_FahrenheitToRankine: ' & _FahrenheitToRankine(32) & ChrW(176) & 'R' & @CRLF) ConsoleWrite('_FahrenheitToReaumur: ' & _FahrenheitToReaumur(32) & ChrW(176) & 'Re' & @CRLF & @CRLF) ConsoleWrite('_KelvinToCelsius: ' & _KelvinToCelsius(273.15) & ChrW(176) & 'C' & @CRLF) ConsoleWrite('_KelvinToFahrenheit: ' & _KelvinToFahrenheit(273.15) & ChrW(176) & 'F' & @CRLF) ConsoleWrite('_KelvinToRankine: ' & _KelvinToRankine(273.15) & ChrW(176) & 'R' & @CRLF) ConsoleWrite('_KelvinToReaumur: ' & _KelvinToReaumur(273.15) & ChrW(176) & 'Re' & @CRLF & @CRLF) ConsoleWrite('_RankineToCelsius: ' & ': ' & _RankineToCelsius(491.67) & ChrW(176) & 'C' & @CRLF) ConsoleWrite('_RankineToFahrenheit: ' & _RankineToFahrenheit(491.67) & ChrW(176) & 'F' & @CRLF) ConsoleWrite('_RankineToKelvin: ' & _RankineToKelvin(491.67) & 'K' & @CRLF) ConsoleWrite('_RankineToReaumur: ' & _RankineToReaumur(491.67) & 'Re' & @CRLF & @CRLF) ConsoleWrite('_ReaumurToCelsius: ' & ': ' & _ReaumurToCelsius(0) & ChrW(176) & 'C' & @CRLF) ConsoleWrite('_ReaumurToFahrenheit: ' & _ReaumurToFahrenheit(0) & ChrW(176) & 'F' & @CRLF) ConsoleWrite('_ReaumurToKelvin: ' & _ReaumurToKelvin(0) & 'K' & @CRLF) ConsoleWrite('_ReaumurToRankine: ' & _ReaumurToRankine(0) & 'R' & @CRLF) EndFunc ;==>ExampleAll of the above has been included in a ZIP file. Temperature.zip Edited October 6, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
rcmaehl Posted March 14, 2012 Share Posted March 14, 2012 Why not make the UDF a general conversion UDF, add things other than Temperature, like KHz to GHz, Centimenters to inches, etc. My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
guinness Posted March 14, 2012 Author Share Posted March 14, 2012 (edited) Why not make the UDF a general conversion UDF, add things other than Temperature, like KHz to GHz, Centimenters to inches, etc.Ease really, but I suppose units of length would be another good UDF e.g. feet to centimetres. Thanks. Edited March 14, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Chimaera Posted March 14, 2012 Share Posted March 14, 2012 And Mph To Kmh but i suppose where do you stop lol If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
guinness Posted March 14, 2012 Author Share Posted March 14, 2012 Yeh, this is why separate UDFs would be easier to maintain and for the end user to follow what the UDF includes/does. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Chimaera Posted March 14, 2012 Share Posted March 14, 2012 Or just write the smaller ones as wrappers i guess Good work either way If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
guinness Posted March 14, 2012 Author Share Posted March 14, 2012 (edited) Or just write the smaller ones as wrappers i guessGood work either wayOr that too, but I don't want to bog down the wrappers section with people asking questions for additions etc. Edited March 14, 2012 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Andreik Posted March 14, 2012 Share Posted March 14, 2012 (edited) Maybe you can add also functions for conversion using Reaumur scale. Sometimes is used in high school. Func ReaumurToCelsius($iTemperature) Return $iTemperature * (5 / 4) EndFunc Func ReaumurToFahrenheit($iTemperature) Return $iTemperature * (9 / 4) + 32 EndFunc Func ReaumurToKelvin($iTemperature) Return $iTemperature * (5 / 4) + 273.15 EndFunc Func ReaumurToRankine($iTemperature) Return $iTemperature * (9 / 4) + 491.67 EndFunc Func CelsiusToReaumur($iTemperature) Return $iTemperature * (4 / 5) EndFunc Func FahrenheitToReaumur($iTemperature) Return ($iTemperature - 32) * (4 / 9) EndFunc Func KelvinToReaumur($iTemperature) Return ($iTemperature - 273.15) * (4 / 5) EndFunc Func RankineToReaumur($iTemperature) Return ($iTemperature - 491.67) * (4 / 9) EndFunc Edited March 14, 2012 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
guinness Posted March 14, 2012 Author Share Posted March 14, 2012 Thanks Andreik, I'll add it to the UDF. I take it you got those conversion formulas from wikipedia too? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Andreik Posted March 14, 2012 Share Posted March 14, 2012 Sure, they are not from my mind. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
guinness Posted March 14, 2012 Author Share Posted March 14, 2012 You never know. I will upload tomorrow. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted March 15, 2012 Author Share Posted March 15, 2012 I've added the Reaumur functions, thanks Andreik. Please see original post. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Spiff59 Posted March 16, 2012 Share Posted March 16, 2012 (edited) What do you think about making it a single function with 3 parameters: $fResult = TempConv($sFrom, $sTo, $fValue) You'd call TempConv("F","C",212) or TempConv("C", "K", 100) It would make it easier to use, and maintain, rather than keeping track of all the function names. The Source code would shrink drastically. Edit: Maybe "Ra" and "Re" for Rankine and Reaumer? I was bored when I got to work this morning Having a fetish for tables, I like this approach: MsgBox(0,"",_Tempconv("c","f",72)) MsgBox(0,"",_Tempconv("F","C",200)) MsgBox(0,"",_Tempconv("C","Ra",100)) MsgBox(0,"",_Tempconv("x","y",99)) Func _TempConv($sFrom, $sTo, $fVal) Local $sKey = $sFrom & $sTo, $aConversions[21][2] = [[20, ""], _ ["CF", "$fVal * (9 / 5) + 32"], _ ; Celsius to Fahrenheit ["CK", "$fVal + 273.15"], _ ; Celsius to Kelvin ["CRa", "($fVal + 273.15) * (9 / 5)"], _ ; Celsius to Rankine ["CRe", "$fVal * (4 / 5)"], _ ; Celsius to Reaumur ["FC", "($fVal - 32) * (5 / 9)"], _ ; Fahrenheit to Celsius ["FK", "($fVal + 459.67) * (5 / 9)"], _ ; Fahrenheit to Kelvin ["FRa", "$fVal + 459.67"], _ ; Fahrenheit to Rankine ["FRe", "($fVal - 32) * (4 / 9)"], _ ; Fahrenheit to Reaumur ["KC", "$fVal - 273.15"], _ ; Kelvin to Celsius ["KF", "($fVal * (9 / 5)) - 459.67"], _ ; Kelvin to Fahrenheit ["KRa", "$fVal * (9 / 5)"], _ ; Kelvin to Rankine ["KRe", "($fVal - 273.15) * (4 / 5)"], _ ; Kelvin to Reaumur ["RaC", "$fVal - 491.67) * (5 / 9)"], _ ; Rankine to Celcius ["RaF", "$fVal - 459.67"], _ ; Rankine to Fahrenheit ["RaK", "$fVal * (5 / 9)"], _ ; Rankine to Kelvin ["RaRe", "($fVal - 491.67) * (4 / 9)"], _ ; Rankine to Reaumur ["ReC", "$fVal * (5 / 4)"], _ ; Reaumur to Celcius ["ReF", "$fVal * (9 / 4) + 32"], _ ; Reaumur to Fahrenheit ["ReK", "$fVal * (5 / 4) + 273.15"], _ ; Reaumur to Kelvin ["ReRa", "$fVal * (9 / 4) + 491.67"]] ; Reaumur to Rankine For $x = 1 to $aConversions[0][0] If $sKey = $aConversions[$x][0] Then Return Execute($aConversions[$x][1]) Next Return SetError(1,1,"Error") Endfunc Edited March 16, 2012 by Spiff59 Link to comment Share on other sites More sharing options...
guinness Posted March 16, 2012 Author Share Posted March 16, 2012 It's an idea actually, because when I created this I was only using Celsius & Fahrenheit so you're correct I need to look at optimising this UDF. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
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