> I am very much interested in knowing how you are doing this, as
> I regularly use Luciano's Alias for daily work. I'll be more
> than happy to add this autocompletion function to it using a
> vector. Let me know the script or the method.
Uday,
I haven't tested this a lot, but it seems to work fine. I stopped
using this early on in favour of another approach - since the
other approach allowed me to use my script files as is, and not
as defined in "Alias_list.txt"
I'll paste in my Aliases.powerpro - I don't advise using it as is
because I made some changes to it. What I'd advise is trying to
understand Luciano's script - and adding the bits concerning the
vector from below:
,----- [ Aliases.powerpro ]
| If (not Map.Exists (myAliasList)) Do
| fp = File.Open(pprofolder++"scripts\Alias_list.txt", "r")
| Counter = 0
| myAliasList = Map.Create(200)
| myAliasVec = Vec.Create(200,1)
| For(;not File.Eof(fp);)
| myLine = File.ReadString(fp)
| myRet1 = Regex.Match (myLine, "([^=]+)[\t]=[\t ]*(.*)", "\1",
"myKey")
| myRet2 = Regex.Match (myLine, "([^=]+)[\t]=[\t ]*(.*)", "\2",
"myValue")
| myAliasList[myKey] = myValue
| myAliasVec[&(counter)]= myKey
| counter = &(counter) + 1
| EndFor
| File.Close(fp)
| EndIf
| myChoice =inputdefault("alias","Enter Alias", "=myAliasVec")
| myRun = myAliasList[myChoice]
| Do (myRun, "", "")
|
| If((myChoice == "alias") AND (Map.Exists (myAliasList)))
| myAliasList = Map.Destroy(myAliasList)
`-----
So the most important lines are:
,-----
| myAliasVec = Vec.Create(200,1)
| myAliasVec[&(counter)]= myKey
| myChoice =inputdefault("alias","Enter Alias", "=myAliasVec")
`-----
The first creates the vector to be used in autocompletion, since
unfortunately maps can't be used.
The second initialises the vector with all the aliases. And the
third incorporates the autocomplete into the runbox.
Let me know if you have any problems.
--
Ravi (http://shell-shocked.org)
PowerPro 3.8.11 on Windows XP
"Ambivalent? Well, yes and no."
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/JV_rlB/TM
---------------------------------------------------------------------~->
**** EDIT YOUR POSTINGS !!!! ****
Please remove as much as possible from original messages before replying to them.
________________________________________________
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/