--- Mockey wrote:

> Hi. Me again, couldn't resist it, hope you don't mind :-)

Not at all�� I appreciate every single bit of feedback I can get! :-)

> But if I get it right you load all your aliases into memory now as
> well in form of a newline-delimited string (Aliases). I don't know 
> for sure but I bet it's more efficient directly calling an element
> of an organized data-structure with map["aliasname"] than searching
> through a complete string with index(), then doing quite a lot of 
> further string manipulation and then reading the whole script file
> up to the desired label into memory again to run the alias.

While it is true that loading everything that's needed into the map
would be possible and not too difficult, it seems that the current
method of alias execution by the script has been overlooked.

The beauty of the way it works, is that the aliases in the script are
defined as nothing more than script labels. This means that all the
script needs to do in order to run an alias is grab the name, prepend
it with ".@" and run it like a script call to a specific label.

To that end, the script doesn't actually open itself for reading when
it calls an alias. PowerPro does all the dirty work here.

> If "modify the script" means modifying/adding/deleting an alias of
> the script this could be done by just changing the according entry in
> the map and in the (ini)file, couldn't it? No need to rebuilt the 
> whole map...

This is true, but the script wouldn't be able to ascertain which
aliases had been modified unless it read the entire script in, and
then compared each alias with its copy in the map.

This would mean that if the entire map were not to be rebuilt, then
the user would have to tell the script which aliases were changed,
possibly through an �Update AliasName� alias.

> Why not? If I'm not mistaken the map could contain simple script runs
> as well like:
> aliasmap["add"] = "[EMAIL PROTECTED]" or
> aliasmap["remove"] = "[EMAIL PROTECTED]"
> but I'd only read the script when it's necessary for more complicated
> stuff, the simple entries like:
> aliasmap["prog"] = "path/to/program"
> would be run directly.

In addition to not having to tell ARB when you modify an existing
alias, another advantage of having the alias commands stored only in a
file and not in memory, is if you have many, many aliases (as Ravi
does) then you won't be cluttering up your memory for the sake of
avoiding a script call.

--- Bruce wrote:

> Another approach would be to store each alias in its own file, as a
> specially named subfolder.  YOu'd then just get the list of file 
> names in the subfolder to build the alias list and run the 
> specifiled file.  

This would no doubt make rebuilding of the alias cache much faster,
but this would be a better solution if aliases were substantially
sized�� most of my aliases run a single line of script code, so having
each of these as individual files seems a bit inefficient to me.

I also like the way that everything's contained in the one file! :-)

However everything's open to debate and opinion of course, so everyone
who's using ARB is free to share their thoughts.

Cheers,
Alex

ICQ# 37414292



****  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/
 

Reply via email to