CSCutstock.gms : Test object oriented C# API using a cutting stock example

Description

Contributor: Lutz Westermann, October 2012


Small Model of Type : .Net


Category : GAMS API library


Main file : CSCutstock.gms

$TITLE 'Test object oriented C# API using a cutting stock example' (PCUTSTOCK,SEQ=29)

$ontext
Contributor: Lutz Westermann, October 2012
$offtext


$set srcRoot %gams.sysdir%apifiles%system.dirsep%CSharp%system.dirsep%

$escape &
$if %system.filesys% == UNIX
$if %sysenv.MPATH% == %&sysenv.MPATH%& $abort.noerror Need Mono to run this on Unix

$                             set COMP csc.exe
$if %system.filesys% == UNIX $set COMP $MPATH/dmcs
$                             set EXEC
$if %system.filesys% == UNIX $set EXEC $MPATH/mono

$if %system.buildcode% == VS8
$if not set flags $set flags /platform:x86
$if %system.buildcode% == WEI
$if not set flags $set flags /platform:x64
$if %system.buildcode% == LEG
$if not set flags $set flags
$if %system.buildcode% == DEG
$if not set flags $set flags /define:__APPLE__

* Make sure that correct GAMS system is found when checking the registry
$if not %system.filesys% == UNIX $call findthisgams -q

$call cp "%gams.sysdir%%system.dirsep%GAMS.net4.dll" . && %COMP% %flags% -out:GMSCutstock.exe "%srcRoot%GMSCutstock%system.dirsep%GMSCutstock.cs" -r:GAMS.net4.dll
$if errorlevel 1 $abort 'Problem compiling GMSCutstock.cs'
$call %EXEC% GMSCutstock.exe "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing GMSCutstock'

$call cp "%gams.sysdir%%system.dirsep%GAMS.net4.dll" . && %COMP% %flags% -out:SimpleCutstock.exe "%srcRoot%SimpleCutstock%system.dirsep%SimpleCutstock.cs" "%srcRoot%SimpleCutstock%system.dirsep%CutstockClass.cs" -r:GAMS.net4.dll
$if errorlevel 1 $abort 'Problem compiling SimpleCutstock.cs'
$call %EXEC% SimpleCutstock.exe "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing SimpleCutstock'