Jump to content

Help with Script


JustinM
 Share

Recommended Posts

I know nothing about Javascript. I didn't write this script but I know what it does. I'm just trying to understand the syntax used. Is there a better way to code this with C# or powershell or a bat file? 

fin4  = fso.OpenTextFile( src4, forReading );
fout = fso.OpenTextFile( dest, forWriting, true );

 try 
 {
    
    var CineCPU;
    var OpenGL;

    while( !fin4.AtEndOfStream ){
        var line = fin4.ReadLine();
        var expCineCPU = /^.*Rendering.*$/;
        var expOpenGL = /^.*fps.*$/;
   
        if(expCineCPU.test(line))
            CineCPU =line
        if(expOpenGL.test(line))
            OpenGL =line
        }
        
      
    fout.WriteLine("========================================================================");
    fout.WriteLine("                         BENCHMARK SCORES                               ");
    fout.WriteLine("========================================================================");
    fout.WriteLine("CineBench Scores");
        CineCPU=CineCPU.replace("Rendering (Multiple CPU) : ","      CPU Score: ");
    fout.WriteLine(CineCPU)
        OpenGL=OpenGL.replace("Shading (OpenGL)                : ","      OpenGL Score: ");
    fout.WriteLine(OpenGL)      
        }
  
 catch( e )
 {
  WScript.Echo( "Error: " + e.description );
  }

 

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...