• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 Advanced search and replace functions

This a fairly generic non-programming specific question. I hope this is in the correct category. I apologize if not.

The search and replace function within GMS is fairly straight forward. The only extra option you have is to search case sensitive, that's about it.

Does anyone have any recommendations for some more advanced search tools?

Here are a couple of examples of things I would like to do. (Never mind why too much, the point is the tools are not sufficient)

1) find // and delete everything after and including that that appears on the same line (remove comments)

2) Find where there is and if statement, ignore everything after that until a new if statement is found without a statement in between. (replace if then if with if && if)

3) Find where if = but not does follow another = (Find where I have missed an extra = symbol out)

Gamemaker can't do this. I'm pretty sure. Could someone recommend something a bit more comprehensive than theGMS text editor environment.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
1) find // and delete everything after and including that that appears on the same line (remove comments)
GMEdit has regular expression search-replace, so you can use
Code:
//.*\r\n
for that.

2) Find where there is and if statement, ignore everything after that until a new if statement is found without a statement in between. (replace if then if with if && if)
Same, but a little trickier (take a look at regexp tutorials and use "preview replace"). Also, watch out - "if A if B then C else D" is not the same as "if A and B then C else D".

3) Find where if = but not does follow another = (Find where I have missed an extra = symbol out)
GMEdit beta has a linter option very specifically to warn about single-equals comparisons.
 
Top