General information
Category:
Forms & Form designer
>>But back to your question ... I don’t want to move all the existing WhatEver() method code into the new corresponding MyWhatEver() method manually, so I plan to write a MoveMethodCodeToMyMethod.PRG program, and run it instead against ALL my existing SCX files. I was just checking out whether or not I would be stuck with a mismatched Methods field / ObjCode field in my SCX. (I have since been told by John Petersen that “Compile Form MyFile” will make things right again)
>>
>>If anybody sees a flaw in this approach, or can think of any side effects that should be accommodated, I would appreciate hearing of them.
>
>Nothing much (I'm doing things like that occasionally), just a few tips: beware of uppercase/lowercase slips while serially replacing your strings for your MyStrings in method code. A safe approach could be to find the string using ATC(), then check for characters surrounding it (white space before it, dot or CR or parentheses after), and then actually replace scx.methods with stuff(methods, position, length, newstring) for each occurence of the string. Preferrably, you may use an array to look for positions of all of the occurences of the string, and then replace them last to first, so their positions don't move.
For som reason, I enjoy string manipulation. Thanks for suggesting an approach. I particularly liked the "last to first" idea that would allow the pre-evaluated "position" parameter in your stuff() example to remain correct all the way through.
Bob
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only