SetProjectFileName

Description

Specifies the name of the project (.pbproj) file PowerBuilder will analyze when the BuildModel function is called.

Applies to

Profiling and TraceTree objects

Syntax

instancename.SetProjectFileName ( projectfilename )

Argument

Description

instancename

Instance name of the Profiling or TraceTree object

projectfilename

A string that identifies the name of the project (.pbproj) file PowerBuilder will analyze


Return value

ErrorReturn. Returns one of the following values:

  • Success! -- The function succeeded

  • FileOpenError! -- The file could not be opened

  • FileInvalidFormatError! -- The file is not in the correct format

If an error occurs, the name is not set.

Usage

Use this function to specify the project file PowerBuilder should analyze with the BuildModel function.

Applications in the solution mode need to call this function (and SetTraceFileName) before calling the BuildModel function. After the project file and the trace file are specified, when the BuildModel function is called for analysis, it will load the Pcode file (in the build folder) in the directory where the project file is located for analysis.

Applications in the workspace mode do not need to call this function. Calling it has no effect.

Examples

This example provides the name of the project file for which a performance analysis model is to be built:

Profiling lpro_model
ErrorReturn ler_ret 
lpro_model = CREATE Profiling
ler_ret = lpro_model.SetTraceFileName("trace.pbp")
IF Ler_ret = Success! Then 
       ler_ret = lpro_model.SetProjectFileName("tracing.pbproj")
       IF Ler_ret = Success! Then 
              lpro_model.BuildModel()
       Else
              Messagebox("Error", "SetProjectFileName Fail")
              Return
       End If
Else
       Messagebox("Error", "SetTraceFileName Fail")
       Return
End If

See also

BuildModel

SetTraceFileName