Weidu REPLACE_TEXTUALLY Scripting Question?
Greener
Member Posts: 430
Hi, I'm trying to patch two lines from AR0125.BCS using REPLACE_TEXTUALLY
Global("bd_tazok_dead","AR0125",0) with Global("TazokDead","GLOBAL",0)
and
SetGlobalGlobal("TazokDead","GLOBAL",1) with SetGlobalGlobal("TazokDead","GLOBAL",1)
Can someone assist me in writing the script?
COPY_EXISTING_REGEXP GLOB ~AR0125.BCS~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY...
Thank you in advance...
Global("bd_tazok_dead","AR0125",0) with Global("TazokDead","GLOBAL",0)
and
SetGlobalGlobal("TazokDead","GLOBAL",1) with SetGlobalGlobal("TazokDead","GLOBAL",1)
Can someone assist me in writing the script?
COPY_EXISTING_REGEXP GLOB ~AR0125.BCS~ ~override~
DECOMPILE_AND_PATCH BEGIN
REPLACE_TEXTUALLY...
Thank you in advance...
0
Comments
REPLACE_TEXTUALLY's pretty simple like that. You can also use special characters, for example, this will also work: Just make sure you're not replacing lines you don't want to replace, if you do use special characters.
So, for your example with those " characters in the string? Those need to be escaped, because otherwise they would delimit the string. Both of the samples Dan_P provided would throw syntax errors.
So, correcting that first one ... Well, I think only the quotes need to be escaped...
Quotes aren't special characters for weidu. Now, if there were square brackets, those would need to be escaped, and only for the text that's being replaced. Special characters aren't used for the new text. I think the fixed example you have would actually fail to install because of the backslash after the comma in the new text.
Edit: GraionDilach corrected one part of this. Quotes are special characters, but they don't need to be escaped when inside tildes. Also, I meant that regexp isn't used in the new text, not "special characters" in general.
Regardless, the method in my original reply works since, like you said, the quotes don't need to be escaped if inside tildes.
Good to know. That's not an interaction I'd ever considered before.