You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: DOCUMENTATION.md
+68-11Lines changed: 68 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2478,17 +2478,18 @@ A collection of Build-in Function available in HT++.
2478
2478
1.[str](#str)
2479
2479
2.[int](#int)
2480
2480
3.[float](#float)
2481
-
4.[Chr](#chr)
2482
-
5.[InStr](#instr)
2483
-
6.[RegExMatch](#regexmatch)
2484
-
7.[RegExReplace](#regexreplace)
2485
-
8.[StrLen](#strlen)
2486
-
9.[SubStr](#substr)
2487
-
10.[Trim](#trim)
2488
-
11.[StrReplace](#strreplace)
2489
-
12.[Mod](#mod)
2490
-
13.[Asc](#asc)
2491
-
14.[StrLower](#strlower)
2481
+
4.[input](#input)
2482
+
5.[Chr](#chr)
2483
+
6.[InStr](#instr)
2484
+
7.[RegExMatch](#regexmatch)
2485
+
8.[RegExReplace](#regexreplace)
2486
+
9.[StrLen](#strlen)
2487
+
10.[SubStr](#substr)
2488
+
11.[Trim](#trim)
2489
+
12.[StrReplace](#strreplace)
2490
+
13.[Mod](#mod)
2491
+
14.[Asc](#asc)
2492
+
15.[StrLower](#strlower)
2492
2493
2493
2494
---
2494
2495
@@ -2624,6 +2625,62 @@ This function is essential for converting integer values, string representations
2624
2625
2625
2626
---
2626
2627
2628
+
### input <aid="input"></a>
2629
+
2630
+
[Go back](#build-in-functions)
2631
+
2632
+
**input**: Prompts the user for input and returns the user's response.
2633
+
2634
+
#### Syntax:
2635
+
2636
+
```ahk
2637
+
str userInput = input(prompt)
2638
+
```
2639
+
2640
+
#### Parameters:
2641
+
2642
+
-_prompt_: The text message to display to the user when asking for input.
2643
+
2644
+
#### Return Value:
2645
+
2646
+
- Returns the text entered by the user as a string.
2647
+
2648
+
#### Example 1:
2649
+
2650
+
```ahk
2651
+
str userName := input("Please enter your name: ")
2652
+
MsgBox, % "Hello, " . userName . "!"
2653
+
```
2654
+
2655
+
#### Explanation:
2656
+
2657
+
The `input` function displays a prompt to the user and captures their input as a string. This is useful for gathering user input in a script, such as names, preferences, or other data.
2658
+
2659
+
In Example 1:
2660
+
2661
+
-`input("Please enter your name: ")` shows a prompt asking the user to enter their name.
2662
+
- The variable `userName` captures the user's input.
2663
+
-`MsgBox` then displays a greeting message: "Hello, [userName]!"
2664
+
2665
+
#### Example 2:
2666
+
2667
+
```ahk
2668
+
str userAge := input("Enter your age: ")
2669
+
MsgBox, % "You are " . userAge . " years old."
2670
+
```
2671
+
2672
+
#### Explanation:
2673
+
2674
+
In Example 2:
2675
+
2676
+
-`input("Enter your age: ")` prompts the user to enter their age.
2677
+
- The variable `userAge` stores the input as a string.
2678
+
-`MsgBox` displays a message: "You are [userAge] years old."
2679
+
2680
+
The `input` function is essential for creating interactive scripts that require user feedback or data. It enables the script to capture and use user-provided information in various applications.
0 commit comments