--- I wrote:
> To that end, the script doesn't actually open itself for reading
> when it calls an alias. PowerPro does all the dirty work here.
--- Mockey wrote:
> Hmmm, does it really? I doubt that PowerPro is clever enough to keep
> a script file in memory to wait for a call to one of its labels. I
> thought every call to a label means that the script file is re-
> opened, re-parsed up to that label, then the commands are parsed and
> then it is closed on a "quit". So a real huge file *might* inflict
> performance here. But of course I might be wrong (again)...
I'm sure you are right�� it seems very unlikely that PowerPro keeps a
script in memory after using it (this would be silly!). What I meant
to say, of course, that PowerPro itself would be much faster at
finding this label than an interpreted PowerPro script.
> OK. But you'll get a pretty huge script file then, which will be
> opened and re-opened lots of times and thus put into disk cache which
> puts it into memory as well, if I'm not mistaken. I still think that
> it should be more effective here to have a data-structure like a map
> in memory than parsing script files and strings from memory. But
> that's just my opinion...
I'm getting quite tempted to use a map instead of an external
script... if I do any more significant work on the script I might
convert it to using a map.
Now that I think about it, checking for an alias' existence would be
much easier using If(AliasMap["AliasName"]) than If(Index(Aliases,
...))�� my only concern for the moment is the passage of parameters
along with an alias.
Of course, if the alias points to a script call, e.g. [EMAIL PROTECTED],
attaching parameters would be trivial:
Local�EscapedParams�=�ReplaceChars(ReplaceChars(Arg(1),�"''",�"''''"),�"'"",�"'''"")
Do(Alias, "('"" ++ Arg(1) ++ "'")")
However, if an alias points to a program, depending on how the alias
is defined, it may be a bit trickier to get the parameter put in the
right place.
Consider the following formats, both of which do pretty much the same
thing as far as I can tell:
Notepad.exe!`%ProgramFiles%\PowerPro\Scripts
Do("Notepad.exe", "", "%ProgramFiles%\PowerPro\Scripts")
In either case, attaching parameters isn't as simple as tacking the
parameter string onto the end.
What if I were to adopt Luciano's approach, where each alias is
defined on one line of a file, and the command, parameters and working
directory are all delimited by something like three pound signs?
Having thought this through now, I feel for the moment that my current
approach is an adequate one but I'm open to any other comments that
may turn me around. :-)
As always, I appreciate your feedback!
Cheers,
Alex
ICQ# 37414292
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/