AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Saving userinput
Goto page 1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Sun Jul 08, 2007 3:19 pm    Post subject: Saving userinput Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Dave72



Joined: 27 Jan 2007
Posts: 30
Location: Canada

PostPosted: Sun Jul 08, 2007 5:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Sun Jul 08, 2007 11:08 pm    Post subject: Reply with quote

Thank you for the response Smile 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. Smile


Last edited by Waltman15 on Mon Jul 09, 2007 1:07 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 7295
Location: Australia

PostPosted: Mon Jul 09, 2007 12:22 am    Post subject: Reply with quote

Waltman15 wrote:
I was thinking bout the possiblity of storing the acronyms in an .ini file or something along those lines, but I would know how to go about that.
Take a look at these two scripts:
Advanced variables / hostrings loaded from an .ini file (the more up-to-date version is further down the page.)
RegEx Powered Dynamic Hotstrings
Back to top
View user's profile Send private message Visit poster's website
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Mon Jul 09, 2007 1:10 am    Post subject: Reply with quote

Thank you Smile 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. Smile
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Z Gecko
Guest





PostPosted: Mon Jul 09, 2007 5:16 am    Post subject: Reply with quote

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

PostPosted: Mon Jul 09, 2007 5:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Mon Jul 09, 2007 1:15 pm    Post subject: Reply with quote

any help?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Z Gecko
Guest





PostPosted: Mon Jul 09, 2007 5:35 pm    Post subject: Reply with quote

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

PostPosted: Mon Jul 09, 2007 6:25 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Tue Jul 10, 2007 3:56 am    Post subject: Reply with quote

Please? Help anyone?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ManaUser



Joined: 24 May 2007
Posts: 1121

PostPosted: Tue Jul 10, 2007 4:42 am    Post subject: Reply with quote

What error?
Back to top
View user's profile Send private message
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Tue Jul 10, 2007 5:33 am    Post subject: Reply with quote

Im sorry, I forgot to post that, I get the error "This line does not contain a recognized action"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Tue Jul 10, 2007 5:41 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Waltman15



Joined: 31 May 2007
Posts: 44

PostPosted: Tue Jul 10, 2007 5:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group