PBORCA_SetDebug

Description

Allows you to reset the bDebug property for the ORCA session after a PBORCA_ConfigureSession has been issued. Methods that invoke the PowerScript compiler use the bDebug setting to evaluate conditional compilation logic.

Syntax

INT PBORCA_SetDebug ( HPBORCA hORCASession, 
   BOOL bDebug );

Argument

Description

hORCASession

Handle to previously established ORCA session

bDebug

Setting for the DEBUG conditional compiler directive


Return value

INT. Typical return codes are:

Return code

Description

0       PBORCA_OK

Operation successful

-1      PBORCA_INVALIDPARMS

hORCASession is not valid


Usage

Allows the bDebug value to be reset during an ORCA session. In typical ORCA applications, bDebug is set in the PBORCA_ConfigureSession method that is called immediately after opening an ORCA session. If you set bDebug with the PBORCA_ConfigureSession method, there is typically no need to call PBORCA_SetDebug later on. If you do not call PBORCA_ConfigureSession or PBORCA_SetDebug, the bDebug value defaults to TRUE.

The PowerScript compiler uses the bDebug value to determine whether to enable or disable DEBUG conditional compilation directives when building or regenerating objects in standard PowerBuilder targets. The bDebug value is not used in Windows Forms targets, since the PBORCA_DeployWinFormProject method uses a setting in the Project object of these targets to determine whether to enable or disable the DEBUG directive.

The following ORCA methods invoke the PowerScript compiler:

Although PBORCA_LibraryEntryCopy and PBORCA_LibraryEntryMove can add or replace objects in a PBL, they do not invoke the PowerScript compiler and do not change the compiled PCODE for the added or replaced objects. If you use these methods to copy or move objects to a destination PBL, the DEBUG conditional compilation setting for these objects should be considered as unknown.

If you are uncertain as to whether the PCODE component of an object matches the current bDebug setting, you can call PBORCA_CompileEntryRegenerate to regenerate it with the current setting.

PBORCA_SetDebug can be called any time after PBORCA_SessionOpen. The PBORCA_SetDebug method does not mark an object as needing recompilation. Although the PBORCA_ApplicationRebuild method invokes the PowerScript compiler, if you use it with the PBORCA_INCREMENTAL_REBUILD option, it will not rebuild an object if the only change would be in the status of its DEBUG directive. Therefore, you should not use the PBORCA_INCREMENTAL_REBUILD option for targets that contain DEBUG conditional compilation logic.

Similarly, you should not use the PBORCA_INCREMENTAL_REBUILD option with the PBORCA_SccRefreshTarget method. If the only difference between the original object and a refreshed object is in its DEBUG conditional compilation status, the object will not refresh when this option is used.

Examples

This example is used by the OrcaScript interpreter to implement the set debug command in OrcaScript:

Int ParserActions::setDebug(HPBORCA hORCA, Bool bDebug)
{
int orcaResult = PBORCA_OK;
orcaResult = PBORCA_SetDebug( hORCA, bDebug);
if( orcaResult != PBORCA_OK )
   orcaError(PBTEXT("set debug "), orcaResult );
return (orcaResult == PBORCA_OK);
}

See also

PBORCA_ConfigureSession