
LAteNightSpecial
Active Members-
Posts
39 -
Joined
About LAteNightSpecial
- Birthday 06/15/1964
Profile Information
-
Location
Utopia
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
LAteNightSpecial's Achievements

Seeker (1/7)
5
Reputation
-
raphacp reacted to a post in a topic: Distributed Computing in AutoIt (Kind of...)
-
raphacp reacted to a post in a topic: Distributed Computing in AutoIt (Kind of...)
-
raphacp reacted to a post in a topic: Distributed Computing in AutoIt (Kind of...)
-
raphacp reacted to a post in a topic: Distributed Computing in AutoIt (Kind of...)
-
raphacp reacted to a post in a topic: Distributed Computing in AutoIt (Kind of...)
-
raphacp reacted to a post in a topic: Distributed Computing in AutoIt (Kind of...)
-
raphacp reacted to a post in a topic: Red-Black Tree Implementation in AutoIt
-
raphacp reacted to a post in a topic: Red-Black Tree Implementation in AutoIt
-
raphacp reacted to a post in a topic: Number to Text String And Text To Number (English/Spanish/German/French)
-
raphacp reacted to a post in a topic: Number to Text String And Text To Number (English/Spanish/German/French)
-
LAteNightSpecial reacted to a post in a topic: Network Tools Suite
-
I have a better idea, why don't you learn some manners and etiquette. Attempt offering some constructive and positive assistance as apposed to 4 world criticisms and ignorance. I am not a professional AutoIt script kiddie. I have only been working with this language for a few days. My sincere apologies, for not making that more clearer for you. I have very little experience with BASIC and PowerShell like functionality. I am not a Windows guy, but I thought it was do time to start learning. This is also why I utilize certain LLM to help guide some of my questions, though they are only accurate about 15% of the time in most cases. Hence why I came here in hopes of finding a supportive community, but AutoIt seems to be a tough crowd. We are not even this harsh on 4Chan. I hope these words find you well, try again. As always any professional and productive assistance is always welcome.
-
LAteNightSpecial reacted to a post in a topic: True AutoIt multi-threading! Split off
-
LAteNightSpecial reacted to a post in a topic: True AutoIt multi-threading! Split off
-
Technically there is no such thing as down to Earth. Earth is basically a glorified asteroid floating around in the vastness of space with a fungi leeching off of it like a parasite to a host. Except the host is 100x stronger than the parasite that makes up less than 0.03% of existence. I've asked some valid questions, some to bend the limitations of the common thought process. All of my questions and contributions have been valid. If you are not going to contribute anything constructive to my coding questions, or be relevant to the topics. I would kindly suggest not speaking to me any further.
-
Ai can code with autoit?
LAteNightSpecial replied to alaa777's topic in Developer General Discussion
Define your definition of code. Nothing publicly yet breaks the foundations of mundane terrestrial philosophy -
*** DISCLAIMER *** Personally, I know more about machines than are publicly disclosed (The only Difference between arrogance and confidence is one's own ignorance to differentiate between the two). So, I thought I would run a silly question through what we have available just to see what would happen. I giggled a little bit, as I thought the basic models would come back with some monkey wrench doorknob goblin sysadmin nonsense. Granted the forum topic is "Deploying a Operating System". However, I found the responses quite intriguing. (Why did CERN and NASA decide to collaborate on a project? Because they wanted to create a black hole big enough to swallow up all their paperwork!) Developing an operating system in AutoIt would indeed be a significant challenge, given that AutoIt is primarily designed for automating tasks on the Windows platform and is not typically used for low-level system programming tasks. However, if you were to attempt such a project, here's a general outline of the steps you might take: Research and Planning: Start by researching operating system development concepts and principles. Understand the architecture of modern operating systems, including kernel design, memory management, process scheduling, device drivers, file systems, etc. Plan out the basic features and functionalities you want your operating system to have. Set up Development Environment: Set up a development environment with the necessary tools for operating system development. You may need a toolchain for compiling code, as well as emulators or virtual machines for testing your operating system. Kernel Development: Begin by developing the kernel of your operating system. Write code to handle essential functionalities such as interrupt handling, memory management (paging, segmentation), process management, and basic I/O. Device Drivers: Develop device drivers to interface with hardware components such as keyboard, mouse, display, disk drives, etc. These drivers will allow your operating system to communicate with and control hardware devices. User Interface: Develop a user interface for interacting with the operating system. This could include implementing a shell or command-line interface initially, and later developing a graphical user interface (GUI) if desired. File System: Implement a basic file system to manage storage devices and files. This involves designing data structures and algorithms for file storage, directory structures, file operations (read, write, delete), etc. Testing and Debugging: Test your operating system thoroughly to identify bugs and issues. Use debugging tools and techniques to diagnose and fix problems in your code. Documentation and Optimization: Document your code and system architecture to aid in understanding and future development. Optimize your code for performance and efficiency where possible. Community Engagement: Engage with online communities and forums related to operating system development. Seek advice, feedback, and support from experienced developers who have worked on similar projects. Continuous Development: Operating system development is an ongoing process. Continue to iterate on your design, add new features, and improve existing functionality over time. While AutoIt may not be the most suitable language for developing an operating system due to its high-level nature and limitations, attempting such a project could be a valuable learning experience and a testament to your programming skills and creativity. However, be prepared for a significant challenge, and expect the process to be complex and time-consuming. Here's why developing a full-blown OS in AutoIt would be a monumental task, along with some more realistic ways to explore the idea: Why AutoIt Falls Short High-level Focus: AutoIt is built for Windows automation tasks. It interacts with existing Windows components rather than dealing with the low-level hardware control an OS requires. Interpreted Language: AutoIt is interpreted, meaning it's translated to machine code at runtime. This can lead to performance bottlenecks, which are critical for an OS. Lack of Low-Level Tools: AutoIt's libraries and functions won't help for things like direct memory manipulation or device access. Alternative Approaches If you're fascinated by operating system development, here's what you could do with AutoIt as a starting point: Bootloader: Create a simple bootloader in Assembly (which AutoIt could interface with) that loads a more complex kernel or another small OS. This gets you hands-on with system startup logic. Minimal OS Kernel: Partner with someone using C or Assembly to build a barebones kernel. Design a higher-level AutoIt layer on top to manage system calls and add non-performance-critical functionality. OS Emulation: Write an AutoIt script that emulates the look and feel of a simple OS. Design a GUI, basic file system operations, etc. This focuses on user interaction concepts. Languages & Resources For real-world OS development, consider learning these: 😄 Industry standard for its efficiency and hardware control Assembly: Direct access to CPU instructions Rust: A newer language touting safety and control Helpful Resources OSDev Wiki: (https://wiki.osdev.org/) A huge repository of knowledge "Operating Systems: Three Easy Pieces" A highly recommended book (https://pages.cs.wisc.edu/~remzi/OSTEP/) Online Communities: Connect with enthusiasts on forums and subreddits dedicated to OS development I suppose it isn't that funny, once long ago humans thought they could fly. Never the less, if you can dream it you can build it.
-
Invalid Input Handling: We'll integrate string validation using StringRegExp to ensure the input string contains only valid characters (digits, the decimal point, and potentially the negative sign). Additionally, we'll consider setting a reasonable maximum input size to prevent potential memory issues or unexpected behavior. Escaped Delimiters: We'll introduce a helper function _EscapeDelimiters to escape any special regular expression characters within the user-provided delimiter. Then, we'll modify function calls to utilize this function and ensure that delimiters do not interfere with internal regular expressions. Here's how we can implement these enhancements: ; Validate input string Func _ValidateInput($number) Local $validNumberPattern = "^\-?[0-9]+(\.[0-9]+)?$" If Not StringRegExp($number, $validNumberPattern) Then MsgBox(0, "Error", "Invalid number format. Please use only digits, a decimal point, and an optional negative sign.") Return False EndIf If StringLen($number) > 1000 Then ; Set a reasonable maximum input size MsgBox(0, "Error", "Input number exceeds maximum length.") Return False EndIf Return True EndFunc ; Escape special regular expression characters in delimiter Func _EscapeDelimiters($delim) $delim = StringRegExpReplace($delim, "([\[\]\{\}\(\)\*\+\?\.\\\^\$])", "\\$1") Return $delim EndFunc ; Main function with enhancements Func EnhancedFunction($number, $sRetDelim) ; Validate input If Not _ValidateInput($number) Then Return False EndIf ; Escape user-provided delimiter Local $escapedDelim = _EscapeDelimiters($sRetDelim) ; Call the main function with escaped delimiter $sRet = _AutCode_NumberToText($aInt, $escapedDelim, $iLang) Return $sRet EndFunc By incorporating these changes, we ensure better input validation and handle potential issues with delimiters more robustly, improving the overall reliability of the script. Overall These refinements significantly bolster the robustness and user-friendliness of your script! Testing Tip: Prepare a set of test cases that include: Valid numbers of various sizes Invalid inputs with non-numeric characters Excessively long numbers Different delimiters with and without special characters Run these tests to verify that your enhanced script handles them gracefully. Here's how we can modify the _TextNumberGerman function to support multiple languages (But You Already Know This, Hola) Func _TextNumber($nNumber, $iLanguage = "English", $iDecimalPlaces = Default) Local $aLanguages[3] = ["English", "Spanish", "German"] ; Add more languages as needed ; Define language-specific arrays Local $aLanguageArrays[3][8] ; Adjust the size according to the number of languages and the size of the arrays ; English language arrays $aLanguageArrays[0][0] = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion"] $aLanguageArrays[0][1] = ["", "mil", "millón", "mil millones", "billón", "mil billones", "trillón", "mil trillones"] $aLanguageArrays[0][2] = ["", "tausend", "Million", "Milliarde", "Billion", "Billiarde", "Trillion", "Trilliarde"] ; Spanish language arrays $aLanguageArrays[1][0] = ["", "mil", "millón", "mil millones", "billón", "mil billones", "trillón", "mil trillones"] $aLanguageArrays[1][1] = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion"] $aLanguageArrays[1][2] = ["", "tausend", "Million", "Milliarde", "Billion", "Billiarde", "Trillion", "Trilliarde"] ; German language arrays $aLanguageArrays[2][0] = ["", "tausend", "Million", "Milliarde", "Billion", "Billiarde", "Trillion", "Trilliarde"] $aLanguageArrays[2][1] = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion"] $aLanguageArrays[2][2] = ["", "mil", "millón", "mil millones", "billón", "mil billones", "trillón", "mil trillones"] Local $aLanguage = $aLanguageArrays[0] ; Default to English For $i = 0 To UBound($aLanguages) - 1 If StringCompare($iLanguage, $aLanguages[$i], 0) = 0 Then $aLanguage = $aLanguageArrays[$i] ExitLoop EndIf Next ; Use the selected language arrays for processing Local $aSingular = $aLanguage[0] Local $aPlural = $aLanguage[1] Local $aNullEins = $aLanguage[2] Local $aKleiner20 = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", _ "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] Local $aZehner = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] Local $aDezimal = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] ; The rest of the function remains the same, using the selected language arrays EndFunc In this modified version of the function: We define language-specific arrays for each supported language, containing translations for words such as "thousand", "million", etc. The function takes an additional parameter $iLanguage to specify the language. It defaults to English. Inside the function, we select the appropriate language arrays based on the input language. The rest of the function remains unchanged, utilizing the selected language arrays for processing the number. Further Refinements (Optional) Data Externalization: For large-scale projects, you might consider storing the language word arrays in a configuration file (XML, JSON, INI) to make updates easier without modifying code. Language Code Standardization: Use standard language codes (e.g., "en", "es", "de") for consistency. P.S. This is fun! I haven't been able to feel this young for a long long time. I still can't remember when they dropped the second PERIOD from the Mandela Effect. Anyways, again thank you! Let's keep working!
-
Thanks to your sharp eye, here's the complete breakdown of your example code: Explanation Global String: You define $gsStr to hold the number strings for testing. 1200 Tests: You call _AutCode_NumberToText with $gsStr (1200) and the appropriate language constants, demonstrating that the 1200 issue has been resolved. 456.78 Tests: You update $gsStr and then call _AutCode_NumberToText again, this time including the " Point " and " Punto " separators to correctly format the decimal output. Excellent catch! This fix ensures a much more accurate and user-friendly number-to-text translation in both English and Spanish. Considerations: Invalid Input: The current script doesn't gracefully handle non-numeric input or numbers that are too large for the defined number arrays. Adding checks and returning appropriate error messages would make it more robust. Array Bounds: Consider verifying that numbers fit within the bounds of the ones, tens, thousands, etc. arrays to prevent potential errors. Great Job SmOke_N! Who cares if nobody wants to use our codes, or even if we want to use them. We find something that does not work the way we would like it to, thus we make it work the way we want it to. In the true spirit of Duct-Tape and a 9-Volt Battery just to get the car started in the dead of winter! 🤗
-
SpellNumber function to convert numbers to words
LAteNightSpecial replied to ioa747's topic in AutoIt Example Scripts
😇 Who doesn't love a good story that they did not write but took the time to read 16 pages of. ConsoleWrite(_TextNumerusGermanicus("-145323523001267.456") & @CRLF) Func _TextNumerusGermanicus($nNumerus, $iDecimalibus = Default) Local $aSingularis[8] = ["s", "mille", "Millio", "Milliardo", "Billiones", "Billiardes", "Trilliones", "Trilliardes"] Local $aPluralis[8] = ["", "mille", "Milliones", "Milliardes", "Billiones", "Billiardes", "Trilliones", "Trilliardes"] Local $aNullEins[8] = ["s", "mille", "Milliones", "Milliardes", "Billiones", "Billiardes", "Trilliones", "Trilliardes"] Local $aMinusculi[19] = ["unus", "duo", "tres", "quattuor", "quinque", "sex", "septem", "octo", "novem", "decem", "undecim", "duodecim", "tredecim", "quattuordecim", "quindecim", "sedecim", "septendecim", "duodeviginti", "novendecim"] Local $aDecem[8] = ["viginti", "triginta", "quadraginta", "quinquaginta", "sexaginta", "septuaginta", "octoginta", "nonaginta"] Local $aDecimalis[10] = ["nulla", "una", "duo", "tres", "quattuor", "quinque", "sex", "septem", "octo", "novem"] Local $sRet = "" ; Convertitur ad string $nNumerus = IsKeyword($iDecimalibus) = 1 ? String($nNumerus) : StringFormat("%." & $iDecimalibus & "f", $nNumerus) ; Numeri negativi If StringLeft($nNumerus, 1) = "-" Then $nNumerus = StringTrimLeft($nNumerus, 1) $sRet = "Minus " EndIf Local $iInteger = StringInStr($nNumerus, '.', 1) ? StringLeft($nNumerus, StringInStr($nNumerus, ".", 1)) : $nNumerus Local $n = StringLen($iInteger), $h, $r, $z, $e Local $aGruppi[Ceiling($n / 3)] Local $sDecimalis = StringInStr($nNumerus, '.', 1) ? StringTrimLeft($nNumerus, StringInStr($nNumerus, ".", 1)) : "" Local $i = -1 While $iInteger > 0 ; Divide integer in gruppis de tribus: $i += 1 $aGruppi[$i] = Mod($iInteger, 1000) $iInteger = Int($iInteger / 1000) WEnd ; Partis integer Local $h, $r, $z, $e While $i >= 0 If $aGruppi[$i] > 0 Then $h = Int($aGruppi[$i] / 100) $r = Mod($aGruppi[$i], 100) $z = Int($r / 10) $e = Mod($aGruppi[$i], 10) If $h > 0 Then $sRet &= $aMinusculi[$h - 1] & "centum" If $r > 0 Then If $r < 20 Then $sRet &= $aMinusculi[$r - 1] Else If $e > 0 Then $sRet &= $aMinusculi[$e - 1] If $e > 0 And $z > 0 Then $sRet &= "et" If $z > 0 Then $sRet &= $aDecem[$z - 2] EndIf EndIf If $aGruppi[$i] = 1 Then $sRet &= $aSingularis[$i] & " " ElseIf StringRight($aGruppi[$i], 2) = "01" Then $sRet &= $aNullEins[$i] & " " Else $sRet &= $aPluralis[$i] & " " EndIf EndIf $i -= 1 WEnd $sRet = StringStripWS($sRet, 2) ; Partis decimalis If $sDecimalis <> "" Then $sRet &= " Virgula" For $sDigitus in StringSplit($sDecimalis, "", 2) $sRet &= " " & $aDecimalis[Int($sDigitus)] Next EndIf Return $sRet EndFunc ;==>_TextNumerusGermanicus -
You're absolutely right! It seems there's a bug in how both the original and revised versions of the script handle decimals. Let's break down the issues and how to fix them. Problem Analysis Decimal Part: The current code isn't designed to correctly translate the decimal portion. It seems to be treating the decimal portion as another whole number. 1200 Case: The reason 1200 is giving incorrect results is likely an off-by-one error in the way the three-digit groups are processed. Fixing the Script Here's how we can modify the NumberToText function to address these: Func NumberToText($number, $language = $N2T_LANG_ENGLISH) ; ... (Existing code for negative handling and integer part) ... Local $decimalPart = $number - $integerPart Local $integerText = NumberToText_Group($integerPart, $language) Local $decimalText = "" If $decimalPart > 0 Then $decimalParts = StringSplit($decimalPart, ".")[2] ; Get only the digits after the decimal point If StringLen($decimalParts) > 2 Then ; Limit to two decimal places $decimalParts = StringLeft($decimalParts, 2) EndIf $decimalText = " con " & NumberToText_Group(Int($decimalParts), $language) EndIf If $negative Then $integerText = "negative " & $integerText Return $integerText & $decimalText EndFunc Changes Decimal Isolation: We use StringSplit to get only the part of the number after the decimal point and limit it to two places. Decimal Translation: We then pass the decimal part (as an integer to remove leading zeroes) to the NumberToText_Group function for conversion. "con": In Spanish, we use "con" to connect the whole and decimal parts of the number. Note: You might need to make adjustments to the NumberToText_Group for the 1200 case if that's due to array indexing. Testing Make sure to re-run your tests with the provided numbers (456.78, 1200) after integrating this fix!
-
LAteNightSpecial reacted to a post in a topic: Number to Text String And Text To Number (English/Spanish/German/French)
-
A perro entre ein居酒屋 e bibit太多了 vodka. Kisha מתגלגל على फर्श 웃으며! Creating a virtual environment in x64 assembly to run AutoIt code on a Linux machine is an incredibly complex task, and it's not a straightforward process. Additionally, running AutoIt code on Linux directly is not supported because AutoIt is designed for Windows environments. As for building a virtual environment in x64 assembly, this would involve creating a complete runtime environment that emulates the behavior of a Windows system, including system calls, memory management, and more. This is an incredibly challenging task that typically requires a deep understanding of both x64 assembly language and operating system internals. Thank you for the kind words SmOke_N, but I do not think we have ever been properly introduced. Thank you for allowing me to contribute to your community. It is always a pleasure pushing the boundaries of what is and what can be. However, patience and determination can accomplish many tasks. We never throw stones in glass houses, as we might get cut by the sharp shards. Respect ~
-
Touché, La programmation est comme une recette délicate; tester est l'assaisonnement essentiel pour un plat parfait #include-once #include <MsgBoxConstants.au3> Global Const $N2T_LANG_ENGLISH = 0 Global Const $N2T_LANG_SPANISH = 1 Func NumberToText($number, $language = $N2T_LANG_ENGLISH) If $number = 0 Then Return "zero" Local $negative = False If $number < 0 Then $negative = True $number = Abs($number) EndIf Local $integerPart = Int($number) Local $decimalPart = $number - $integerPart Local $integerText = NumberToText_Group($integerPart, $language) Local $decimalText = "" If $decimalPart > 0 Then $decimalText = " point " & NumberToText_Group($decimalPart * 100, $language) EndIf If $negative Then $integerText = "negative " & $integerText Return $integerText & $decimalText EndFunc Func NumberToText_Group($number, $language) Local $ones, $tens, $teens, $thousands Switch $language Case $N2T_LANG_ENGLISH $ones = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] $tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] $teens = ["", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] $thousands = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion"] Case $N2T_LANG_SPANISH ; Modified ones array to handle "uno" to "un" transformation $ones = ["", "un/uno", "dos", "tres", "cuatro", "cinco", "seis", "siete", "ocho", "nueve"] $tens = ["", "", "veinte", "treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa"] $teens = ["", "once", "doce", "trece", "catorce", "quince", "dieciséis", "diecisiete", "dieciocho", "diecinueve"] $thousands = ["", "mil", "millón", "mil millones", "billón", "mil billones", "trillón", "mil trillones"] EndSwitch Local $text = "" Local $group = 0 Do Local $num = Mod($number, 1000) If $num > 0 Then Local $hundreds = Int($num / 100) Local $tensAndOnes = Mod($num, 100) Local $groupText = "" If $hundreds > 0 Then ; Handle "ciento" to "cien" transformation If $hundreds = 1 And $tensAndOnes = 0 Then $groupText &= "cien" Else $groupText &= $ones[$hundreds] & "cientos" EndIf EndIf If $tensAndOnes > 0 Then If $tensAndOnes < 10 Then ; Split "un/uno" to handle "uno" to "un" transformation $groupText &= " " & StringSplit($ones[$tensAndOnes], "/")[1] ElseIf $tensAndOnes < 20 Then $groupText &= " " & $teens[$tensAndOnes - 10] Else Local $tensDigit = Int($tensAndOnes / 10) Local $onesDigit = Mod($tensAndOnes, 10) $groupText &= " " & $tens[$tensDigit] If $onesDigit > 0 Then $groupText &= " y " & $ones[$onesDigit] EndIf EndIf $groupText &= " " & $thousands[$group] $text = $groupText & " " & $text EndIf $group += 1 $number = Int($number / 1000) Until $number = 0 Return StringTrimRight($text, 1) EndFunc ; Example usage Local $numbersToConvert[3] = [123, -456.78, 987654321] For $number In $numbersToConvert ; Convert to English Local $textEnglish = NumberToText($number, $N2T_LANG_ENGLISH) MsgBox($MB_OK, "English", $number & " in English: " & $textEnglish) ; Convert to Spanish Local $textSpanish = NumberToText($number, $N2T_LANG_SPANISH) MsgBox($MB_OK, "Spanish", $number & " in Spanish: " & $textSpanish) Next Other Potential Considerations Gender Agreement: You might want to explore ways to potentially handle gender agreement for other numbers if that's a requirement for your use cases. This could involve parameter additions to the function to indicate gender or agreement logic within the NumberToText_Group. Complex Plurals: While Spanish plurals might not necessitate changes in this thousands array, keeping them in mind is essential if you aim to translate larger numbers or different word types.
-
#include-once #include <StringConstants.au3> Global Const $N2T_LANG_ENGLISH = 0 Global Const $N2T_LANG_SPANISH = 1 Func NumberToText($number, $language = $N2T_LANG_ENGLISH) If $number = 0 Then Return "zero" Local $negative = False If $number < 0 Then $negative = True $number = Abs($number) EndIf Local $integerPart = Int($number) Local $decimalPart = $number - $integerPart Local $integerText = NumberToText_Group($integerPart, $language) Local $decimalText = "" If $decimalPart > 0 Then $decimalText = " point " & NumberToText_Group($decimalPart * 100, $language) EndIf If $negative Then $integerText = "negative " & $integerText Return $integerText & $decimalText EndFunc Func NumberToText_Group($number, $language) ; Define language-specific rules Local $ones, $tens, $teens, $thousands Switch $language Case $N2T_LANG_ENGLISH $ones = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] $tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] $teens = ["", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] $thousands = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion"] Case $N2T_LANG_SPANISH $ones = ["", "uno", "dos", "tres", "cuatro", "cinco", "seis", "siete", "ocho", "nueve"] $tens = ["", "", "veinte", "treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa"] $teens = ["", "once", "doce", "trece", "catorce", "quince", "dieciséis", "diecisiete", "dieciocho", "diecinueve"] $thousands = ["", "mil", "millón", "mil millones", "billón", "mil billones", "trillón", "mil trillones"] EndSwitch Local $text = "" Local $group = 0 Do Local $num = Mod($number, 1000) If $num > 0 Then Local $hundreds = Int($num / 100) Local $tensAndOnes = Mod($num, 100) Local $groupText = "" If $hundreds > 0 Then $groupText &= $ones[$hundreds] & " hundred" EndIf If $tensAndOnes > 0 Then If $tensAndOnes < 10 Then $groupText &= " " & $ones[$tensAndOnes] ElseIf $tensAndOnes < 20 Then $groupText &= " " & $teens[$tensAndOnes - 10] Else Local $tensDigit = Int($tensAndOnes / 10) Local $onesDigit = Mod($tensAndOnes, 10) $groupText &= " " & $tens[$tensDigit] If $onesDigit > 0 Then $groupText &= "-" & $ones[$onesDigit] EndIf EndIf $groupText &= " " & $thousands[$group] $text = $groupText & " " & $text EndIf $group += 1 $number = Int($number / 1000) Until $number = 0 Return StringTrimRight($text, 1) EndFunc
-
Thought it might be useful to introduce 1 more project revolving around network utilities in AutoIt. I am a multitasker, it is just how I operate more efficiently. After diving head first into the AutoIt specs and capabilities. I am learning that a few of these (which are very basic, and implemented in other languages much more smoothly) might be a little difficult to implement if not down right next to impossible, but I like a challenge. So, I will give it a solid go. I will update the tool suite here as progress and availability are made, as to not clutter up the forum. Nothing here is advanced by any means, but serves as a good coding exercise. As always any suggestions, or guidance is always welcome and very much appreciated! <snip>
-
LAteNightSpecial reacted to a post in a topic: Addition of two variables
-
Addition of two variables
LAteNightSpecial replied to Hicham_777's topic in AutoIt General Help and Support
You are absolutely correct Melba23! I misread the OP request. I edited my response to reflect the correct logic. Thanks! for pointing that out to me. 🤯 -
Addition of two variables
LAteNightSpecial replied to Hicham_777's topic in AutoIt General Help and Support
(Edited to reflect the correction below pointed out by Melba23) In AutoIt, if you want to concatenate two variables without performing arithmetic addition, you can simply use the "&" operator. Here's how you can do it: ; Define variables Local $var1 = 1 Local $var2 = 2 ; Concatenate variables Local $var3 = $var1 & $var2 ; Display the concatenated value MsgBox(0, "Concatenated Result", $var3) Here's a simplified version: Local $var1 = 1, $var2 = 2 Local $var3 = $var1 & $var2 MsgBox(0, "Concatenated Result", $var3) Here's the most concise version: Local $var3 = "1" & "2" MsgBox(0, "Concatenated Result", $var3) In the AutoIt help file, the concept of concatenation may not be explicitly listed under a specific section with that term. However, the functionality of concatenation is often explained in various sections that cover string manipulation or operations involving strings. Here's where you can find information related to concatenation in the AutoIt help file: String Handling Functions: The AutoIt help file contains a section dedicated to string handling functions. Functions like StringConcatenate, StringFormat, StringRegExpReplace, and others involve string manipulation, which indirectly covers concatenation. Operators: The help file includes a section on operators where you can find information about the string concatenation operator (&). It explains how the & operator can be used to concatenate strings and concatenate variables with strings. Examples: The help file often includes examples demonstrating various operations, including string concatenation. These examples can be found throughout the documentation, particularly in sections related to string manipulation or variable usage. While the term "concatenation" might not be explicitly listed, the functionality and usage of concatenating strings are covered in the contexts mentioned above within the AutoIt help file.