Re: Can this be automated in the VBE?
- From: dpb <none@xxxxxxx>
- Date: Tue, 29 Jan 2008 17:59:54 -0600
RB Smissaert wrote:
It is not the function itself that is the problem, but the lines of code that call the Function or Sub.....
Arguments will have to match and this can't be a simple find and replace.
Arguments will have to match what? The dummy and actual argument association is positional, not by variable name.
There should be only one function statement and N calls/references.
How many references are there as a ballpark estimate?
If, of course, one were in a hurry to get something working owing to deadlines or somesuch, the answer would be Ralph's--make the routine w/ the new number of arguments a new function and change the existing routine to call it, passing the required ones--essentially the whole problem fixed in two edits and then the rest can be dealt with at leisure.
If the number of variables used in the call is relatively small and there are more than one instance of each, it might be possible in a reasonable time to simply create the substitution pattern on the fly from a sequential search for the call/reference. If there are still too many to even do that, a fully-automated technique would require the pattern-matching engine to push the arguments on a stack in order to then push them into the replacement string.
On consideration, I don't recall I've done something like that in 30 years that I can recall since "once upon a time" w/ the old DEC TECO editor when we did a major code conversion from a CDC system to an early desktop coprocessor i960 system. Consequently, while I'm sure there must be some, for PC, I don't have a direct link.
I'd expect emacs or some similar would have a capability. I'm pretty sure I could write a macro relatively quickly w/ my old Brief editor using it's search facility...
On Windows, I've evaluated Zeus for its Brief keymapping, but I've not tried its macro facility -- it's not compatible w/ Brief, unfortunately.
--dpb
.
- Follow-Ups:
- Re: Can this be automated in the VBE?
- From: RB Smissaert
- Re: Can this be automated in the VBE?
- From: Ralph
- Re: Can this be automated in the VBE?
- References:
- Can this be automated in the VBE?
- From: RB Smissaert
- Re: Can this be automated in the VBE?
- From: Ralph
- Re: Can this be automated in the VBE?
- From: RB Smissaert
- Can this be automated in the VBE?
- Prev by Date: Re: Counting the Dates
- Next by Date: Re: What has happened to Command$ function?
- Previous by thread: Re: Can this be automated in the VBE?
- Next by thread: Re: Can this be automated in the VBE?
- Index(es):
Relevant Pages
|