Hotstring Length - Hit enter after select amount of characters for all hotstrings? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
arochon
Posts: 32
Joined: 04 Apr 2018, 07:49

Hotstring Length - Hit enter after select amount of characters for all hotstrings?

17 Apr 2018, 11:04

I have an old computer application that I use for work where there are 60 spaces to input characters. After that you have to hit enter to go to the next line to continue typing.

This creates a problem when using hotstrings that are lengthy. This is because when you get to 60 characters and enter is not pressed the program does not automatically go to the next line, and the rest of the characters in the hotstring are not entered.

Is there a way to format hotstrings to hit enter after a select # of character spaces?

I know you can do this

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



But is there a way to format all of your hotstrings you have in a script without doing this individually to each phrase?

To be clear:
I want to change an option or insert a line of code if possible to make the code below function as the code presented above without having to put parentheses in the code and counting characters.

Code: [Select all] [Download] GeSHi © Codebox Plus

::fbrkp::Replaced the front brake pads and resurfaced the rotors. Inspected brake calipers, and all hardware and brake lines. Road tested the vehicle to confirm the repair.
::tbsp::Removed the throttle body boot and scrubbed off the carbon build up from the throttle body.
::tbeltp::Replaced the timing belt, adjusted tension, reset timing,and inspected all the associated components.

Thank you in advance for any help!

Cheers
arochon
Odlanir
Posts: 274
Joined: 20 Oct 2016, 08:20

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?

17 Apr 2018, 12:10

Try this:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

____________________________________________________________________________
Windows 7 Home Premium 64 bit - Autohotkey v1.1.24.02 64-bit Unicode
arochon
Posts: 32
Joined: 04 Apr 2018, 07:49

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?

17 Apr 2018, 15:13

Odlanir,

Thank you for the example!

arochon
arochon
Posts: 32
Joined: 04 Apr 2018, 07:49

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?

21 Apr 2018, 22:27

How would I be able to put a variable in for 60 without throwing an error?

For example

cpl_thirty := 30
cpl_fourty := 40
cpl_fifty := 50
cpl_sixty := 60
cpl_seventy := 70
cpl_eighty := 80
cpl_ninety := 90

It does not work when I insert %cpl_sixty% where 60 was...


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
Exaskryz
Posts: 2873
Joined: 17 Oct 2015, 20:28

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?

21 Apr 2018, 22:42

What happens if you just use if ( len + ( Strlen(Arr[a_index] " ")) <= cpl_sixty) { ? I haven't run the code, but notice how we didn't use %len% in there -- When you wrap the If expression in parentheses, every word put in there are treated as the names of variables instead of strings, so you don't want to use the %s.
arochon
Posts: 32
Joined: 04 Apr 2018, 07:49

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?

21 Apr 2018, 22:54

Exaskryz,

This happens:

CUSTOMER
STATES
CHECK
ENGINE
LIGHT
ON
-
PLEASE
DIAGNOSE
AND
ADVISE

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

arochon
Posts: 32
Joined: 04 Apr 2018, 07:49

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?  Topic is solved

21 Apr 2018, 23:28

Found this way to accomplish it

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

swagfag
Posts: 1088
Joined: 11 Jan 2017, 17:59

Re: Hotstring Length - Hit enter after select amount of characters for all hotstrings?

22 Apr 2018, 04:16

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: buttshark, TAC109 and 73 guests