 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Sun Jul 08, 2007 3:19 pm Post subject: Saving userinput |
|
|
Hello everyone,
Im currently working on a program, AcroLiminator, one of the requests, is an ability to add your own acronyms. I was wondering how this would be done, and also how I could add the option to delete the default acroynms? Thank you for any help you may provide.
Walt
P.S : If you want it I will post my code, but it is over 1000 lines long, so I figured I would wait til' someone requested it. Thanks again. |
|
| Back to top |
|
 |
Dave72
Joined: 27 Jan 2007 Posts: 30 Location: Canada
|
Posted: Sun Jul 08, 2007 5:12 pm Post subject: |
|
|
How are the existing acronyms stored ?
Id guess a good way is in an outboard file, like a .csv or otherwise delimited file. Perhaps line by line..
ACRONYM,meaning.
ACRONYM2, meaning2.
etc
That way you could easily retrieve the matching set, edit either value, sort etc etc. (in this ex the comma seperates the AC from the meaning, and the period seperates the sets) |
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Sun Jul 08, 2007 11:08 pm Post subject: |
|
|
Thank you for the response The currently acronyms are encoded in the program, heres an example of my code.
::btw::
expanded = by the way
MsgBox 4, AcroLiminator 0.1 Beta, Convert btw to %expanded% ?
ifMsgBox, yes
Send, %expanded%
else
Send, btw
return
I was thinking bout the possiblity of storing the acronyms in an .ini file or something along those lines, but I wouldn't know how to go about that. Thanks again for the response. 
Last edited by Waltman15 on Mon Jul 09, 2007 1:07 am; edited 1 time in total |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Mon Jul 09, 2007 1:10 am Post subject: |
|
|
Thank you Im not sure how to go about getting this to do what I want, so Im gonna read it and see how to do what I want. Thanks.  |
|
| Back to top |
|
 |
Z Gecko Guest
|
Posted: Mon Jul 09, 2007 5:16 am Post subject: |
|
|
Here is a simple solution, using an ini-file
| Code: |
loop
{
Input, UserInput, V, {enter}.{tab}{Space}
IfInString, ErrorLevel, EndKey:
{
IniRead, OutputVar, abrev.ini, abreviation, %UserInput%
if OutputVar != ERROR
{
StringSplit, EL_array, ErrorLevel, :
loopcount := StrLen(UserInput)
loop, %loopcount%
{
Send {BS}
}
Send {BS}%OutputVar%{%EL_array2%}
}
}
} |
The corresponding ini-File should be named "abrev.ini" and look like this
| Code: | [abreviation]
abc=alpha beta gamma
rtfm=read the **** manual
[quote][/quote] |
|
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Mon Jul 09, 2007 5:27 am Post subject: |
|
|
Heres my code..
| Code: | ::btw::
expanded = by the way
MsgBox 4, AcroLiminator 0.1 Beta, Convert btw to %expanded% ?
ifMsgBox, yes
Send, %expanded%
else
Send, btw
return
|
How would I go about having the message show verifying the user wants to convert the acronym to the word? At this time, the words inside the .ini that do not exist in the code, simply change without the verifcation. While as, my words existing in the code and the list, ask the message. Sorry for all the trouble.
Walt |
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Mon Jul 09, 2007 1:15 pm Post subject: |
|
|
| any help? |
|
| Back to top |
|
 |
Z Gecko Guest
|
Posted: Mon Jul 09, 2007 5:35 pm Post subject: |
|
|
I don´t really understand, what you you mean,
do you want this?
| Code: | loop
{
Input, UserInput, V, {enter}.{tab}{Space}
IfInString, ErrorLevel, EndKey:
{
IniRead, OutputVar, abrev.ini, abreviation, %UserInput%
if OutputVar != ERROR
{
MsgBox 4, AcroLiminator 0.1 Beta, Convert %Userinput% to %OutputVar% ?
fMsgBox, yes
{
StringSplit, EL_array, ErrorLevel, :
loopcount := StrLen(UserInput)
loop, %loopcount%
{
Send {BS}
}
Send {BS}%OutputVar%{%EL_array2%}
}
}
}
} |
|
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Mon Jul 09, 2007 6:25 pm Post subject: |
|
|
Thank you Z Gecko, I think that is what I want, but the following line of code brings upon an error.
| Code: | | Input, UserInput, V, {enter}.{tab}{Space} |
Once again, sorry for all the trouble.
Walt  |
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Tue Jul 10, 2007 3:56 am Post subject: |
|
|
| Please? Help anyone? |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Tue Jul 10, 2007 4:42 am Post subject: |
|
|
| What error? |
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Tue Jul 10, 2007 5:33 am Post subject: |
|
|
| Im sorry, I forgot to post that, I get the error "This line does not contain a recognized action" |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Tue Jul 10, 2007 5:41 am Post subject: |
|
|
you have to post the whole error message. hit Ctrl C in the window with the error message, and you can paste it here in the forum. put it inside quote tags:
[quote]
;paste here
[/quote] _________________
(Common Answers) |
|
| Back to top |
|
 |
Waltman15
Joined: 31 May 2007 Posts: 44
|
Posted: Tue Jul 10, 2007 5:43 am Post subject: |
|
|
Sorry Engunneer, new to all of this, thanks for the help.
So its,
| Quote: | ---------------------------
AcroLiminator.ahk
---------------------------
Error at line 20.
Line Text: Input, UserInput, V, {enter}.{tab}{Space}
Error: This line does not contain a recognized action.
The program will exit.
---------------------------
OK
---------------------------
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|