Jump to content
Sign in to follow this  
ken82m

Array detect if inbetween #cs and #ce

Recommended Posts

ken82m

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

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites
dbzfanatic

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.

Share this post


Link to post
Share on other sites
dbzfanatic
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.

Share this post


Link to post
Share on other sites
ken82m

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


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites
ken82m

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

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites
Richard Robertson

Technically, AutoIt doesn't support nested comment blocks. At the sign of the first end directive, the comment block is ended.

Share this post


Link to post
Share on other sites
Richard Robertson

Sorry then. I didn't consult the help document because I've never really heard of comments being nested. I know in languages like C++ the block comment ends at */ no matter how many /* you had.

Share this post


Link to post
Share on other sites
Richard Robertson

Not really. A language can't be smart. It can be smartly written, but the language itself has no capabilities to learn.

Share this post


Link to post
Share on other sites
ken82m

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


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.