Ticket #1159: test.c

File test.c, 200 bytes (added by hkiel, 15 years ago)

{{{OpenModelica 1.5.0 Copyright (c) OSMC 2002-2009

To get help on using OMShell and OpenModelica, type "help()" and press enter.

cd()

"C:/OpenModelica1.5.0/tmp"

system("gcc -c test.c")

0

loadFile("test.mo")

true

simulate(Motor, stopTime=1.0, numberOfIntervals=2000)

record SimulationResult

resultFile = "Motor_res.plt"

end SimulationResult;

}}} edit test.h such that a compile error must occur (e.g. "int" -> "intx")

>> simulate(Motor, stopTime=1.0, numberOfIntervals=2000)

record SimulationResult

    resultFile = "Motor_res.plt"

end SimulationResult;
 
>> }}}
Line 
1int Count_Fkt(double omega)
2{
3    static double lastomega = 0;
4    static int x = -20;
5
6    if (omega != lastomega)
7    {
8        x++;
9
10        lastomega = omega;
11    }
12
13    return x;
14}