Jump to content
IGNORED

OT: Notepad++ tips?


Opry99er

Recommended Posts

I am currently going through a huge conversion in a game project replacing virtually all the "alike" variables into indexed arrays.

 

Problem is, when I do a 'search and replace', it isn't looking for exclusive variable names, rather--any portion of any string that has the letter combination gets "found" and I have to toggle through 20-30 non-variable string portions in order to find the 4-5 actual variable references for changing.

 

For instance... If I want to replace MHP with HP(3,2), I have to cycle through all references to MMHP,BMHP,SMHP, etc while looking for the sovereign "MHP" variable.

 

Is there an option in Find and Replace that will narrow down the search to ONLY find or replace the variable MHP with HP(3,2)?

 

Would using quotation marks around the search object do it, or is there a box I can click or something?

 

I have about 40 variables to replace with arrays, so just doing ONE set of (4,2) took about 15 minutes last night.

 

I am away from my computer right now, but I will be returning to the conversion tonight.

 

Any help would be appreciated. :)

Edited by Opry99er
Link to comment
Share on other sites

The problem with text editors is that they only know text. This is where an IDE with intellisense really shines because the editor is parsing the code and understands the difference between what is a variable vs. a string, vs. a comment, etc. Such editors let you do something call "refactor" a variable, i.e. change its name (or its type) easily and correctly. Syntax highlighting is a crude form of intellisense but it does not have the power to do things like refactoring of variables or functions.

 

Sadly I do not know of any intellisense editors for BASIC (any BASIC), let alone our specific dialect. In these cases I use the "replace - next" feature that most editors have. Replace-next will replace the current match, then find the next match, all with a single click. This lets you put your eyes on each match quickly and decide if you want to replace it or skip it.

Link to comment
Share on other sites

...Sadly I do not know of any intellisense editors for BASIC (any BASIC), let alone our specific dialect. In these cases I use the "replace - next" feature that most editors have. Replace-next will replace the current match, then find the next match, all with a single click. This lets you put your eyes on each match quickly and decide if you want to replace it or skip it.

FreeBASIC + Geany appears to have some capabilities; I'm pretty sure I saw Geany recognizing variables, but I'm not positive, I've only been playing with FreeBASIC for a couple days now. I also just got FreeBASIC syntax highlighting to work in Pluma, but now that you mention it I should write a .lang file for our dialect :D.

Link to comment
Share on other sites

I was able to complete the conversion last night.

 

I thought the leading space would do the trick, but it did not, as there were lines in there like

 

AHP=MHP

 

That was missed in the search.

 

I did find the "whole word only" box, which I cannot believe I.missed the other night. :) That did the trick.

 

Once my multi-dimensional arrays were completed, the one dimensional arrays went fast. Took about 50 minutes last night to completely transition the variables.

 

Took another 20 or so minutes to debug the INPUT routines from disk. All is well. Thanks guys... For your help.

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...