Wrong behaviour of Target32Bit

I’m using the following code within a pre-build script to determine if the (desktop) app is built as 32bit or 64bit application.
The problem: if I set the architecture to “x86 32bit” and try to compile, Target32Bit is not True.

If TargetARM Then Print(" targetARM = true") Else Print(" targetARM = false") If TargetX86 Then Print(" targetX86 = true") Else Print(" targetX86 = false") If Target32Bit Then Print(" target32bit = true") Else Print(" target32bit = false") If Target64Bit Then Print(" target64bit = true") Else Print(" target64bit = false")

According to the documentation (Target32Bit and UserGuide - 64-Bit Guidelines) it should, isn’t it?

Does Target32Bit only work after the compilation (at run time within the app)?
Is Target32Bit not set before the build itself is started?

How would you determine if it is a 32 or 64bit application at the pre build script stage?

Target32Bit is for application code. If you need something that’ll work in a build script you’d be better off using CurrentBuildTarget.

http://documentation.xojo.com/topics/build_automation/ide_scripting/introduction.html_Building_Commands#CurrentBuildTarget_As_Integer_.28read-only.29

or one of the other constants which have been available for about a year…

CurrentBuildTargetIs32Bit
CurrentBuildTargetIs64Bit
CurrentBuildTargetIsIntel
CurrentBuildTargetIsARM

http://documentation.xojo.com/topics/build_automation/ide_scripting/introduction.html_Constants

Ah, yes, my fault. Thanks for pointing me to it, Greg!