Support Board
Date/Time: Fri, 10 Jan 2025 23:04:24 +0000
Post From: Arithematic doesn't work
[2016-10-07 02:39:10] |
bala - Posts: 74 |
Here is a simple code used on your simple moving average function: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ float x1; float testsum; if (sc.Index == 0) {testsum = 0;} If (sc.Index >0) { x1=sc.BaseDataIn[SC_LAST][sc.Index]; testsum += x1; SCString Buffer; Buffer.Format("Test by %d -%f - %f",sc.Index,x1,testssum); sc.AddMessageToLog(Buffer, 1); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++it's The above doesn't update testsum at all despite being in loop!! A similar loop works fine in visual c++. What am I doing wrong..? |