Device or Desktop

DaveW

Active Member
Licensed User
Longtime User
Is there a simple way to determine if the program is running on a Device or Desktop - one which will allow the compiler to use/omit code?

For example, I have

img1clk.New1(img1obj.value,"MouseClick")

in my program but this has to be

img1clk.New1(img1obj.value,"MouseDown")

on the Device. I don't want to have to edit this (and remember what to edit) every time I transfer the program to the device or back again.

In Delphi they have
{$IFDEF VER130}
do this
{$ELSE}
do that
{$ENDIF}

is there something similar in Basic4PPC?
 

Mr_Gee

Active Member
Licensed User
Longtime User
try the "cPPC = true" constant :
If cPPC = true Then
' running on the PPC
Else
'running on the Desktop
End If
 

agraham

Expert
Licensed User
Longtime User
img1clk.New1(img1obj.value,"MouseDown")
This will work on the desktop as well. In general what works on a device will work on the desktop but not vice versa. The Compact Framework on the device is a higly compatible subset of the full Framework. This is why a lot of code, libraries and even compiled exes, intended for the device will actually run on the desktop.
 
Top