Jump to content

Getting braces{} contents


ur
 Share

Recommended Posts

I am reading a text file and getting the functions from it.Previously the functions are in vbscript code with "Function name" and "End Function" as start and end points.And I parsed the same by setting the start and end points like below.

The code in the text will be like this previously

Function GetEnvironmentVariable(sType, sName)
    Log "Reading " & sType & " environment variable " & sName
    Dim oEnvVar
    On Error Resume Next
    SET oEnvVar = oShell.Environment(sType)
    Log "Environment variable value: " & oEnvVar(sName)
    GetEnvironmentVariable = oEnvVar(sName)
    SET oEnvVar = NOTHING
End Function

Now I need to read powershell code and the code format is as below.

Function MsgBox($sMsg)
{
    $a = new-object -comobject wscript.shell
    $b = $a.popup($sMsg,0,"",1)
}

 

Can anyone suggest me if the file is having somany functions and I need to read the particular function when the user requests it in my auotoit code.

Link to comment
Share on other sites

It is not clear to me at all, what you are asking, so perhaps you need to rephrase it another way ... perhaps providing a before and after.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

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

×
×
  • Create New...