Jump to content

Array detect if inbetween #cs and #ce


ken82m
 Share

Recommended Posts

I'm working on customizing a script that parses my source code.

The source code is in an single column 1-type array $SourceCodeArray

It's in a string $Source using @CRLF's too if that helps.

So it finds the row I'm looking for.

Can anyone think of the logic to see if it is inbetween rows that are commented out with #cs/ #ce

Thanks,

Kenny

Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

The only way I could think would be to either run the script on itself and do FileRead() and StringBetween() or make a seperate script using that method.

Link to comment
Share on other sites

HA! Hubertus used one of my suggestions, running the script on itself and the RegExp is basically the same as the StringBetween() I mentioned (come to think of it StringInStr() might work too). So thank you Hubertus for doing the script and saving me some time.
Link to comment
Share on other sites

Cool I'll give it a try now. Thanks guys :mellow:

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Very very nice, works perfectly :mellow:

I inserted this into the second line of your For loop.

Thanks for the help with this!

Kenny

If StringLeft(StringStripWS($sArray[$sLine], 1), 1) = ";" Then Return 1 ;Added to check for leading ";"
Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

boy you really did get bored lol

but even better, thanks :mellow:

as far as the nested comments I really can't understand the point lol

I mean I would just end the comment block and start another when my commands had completed.

But hey if I don't like em I don't have to use em lol

Thanks guys.

-Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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