Page 2 of 2

Re: Detect whether PB 5.70 DPi flag is checked

Posted: Mon Mar 09, 2020 9:44 pm
by Blue
Message to Fred :
Fred wrote:Just forgotten. Moved to feature request.
So, have you remembered to add the promised constant to PB 5.72 ?

Re: Detect whether PB 5.70 DPi flag is checked

Posted: Thu Nov 26, 2020 5:43 am
by Blue
Since PB 5.73 has just been released with still no sign of the promised constant, here is a modified version of the Assembly language code to test whether the DPi_aware option is checked.
I came to this solution after reading carefully (and finally understanding...) the inline assembler entry of the Help file. It really does not get much simpler than the following single Assembly language command :

Code: Select all

EnableASM
Procedure.i DPi_option_checked()
  MOV eax, dword [PB_Compiler_DPIAware] 
  ProcedureReturn
EndProcedure
DisableASM

If DPi_option_checked()
  ; do this and that
EndIf

Debug "DPi_option_checked() ? " + DPi_option_checked()
I kept the PB ASM commands pair outside the procedure only for the sake of greater clarity. It would, of course, make better sense inside the procedure.