Support Board
Date/Time: Tue, 16 Sep 2025 01:30:59 +0000
Conversion issues /float/int and int/float
View Count: 775
[2021-02-01 17:33:27] |
User92573 - Posts: 574 |
Dear Support Thank you for answering the earlier request and my apologies for taking more of your time. My programming in ASCIL is certainly getting a lot better but there are a few things I still struggle with. I'm sure it's pretty simple but your assistance would be a great help. Simple example: SCSubgraphRef updatedMovingAverageLength = sc.Subgraph[3] // this array holds the updated moving average length 'but its a float" SCInputRef input_MovingAverageLength = sc.Input[0] if(sc.SetDefaults) { input_MovingAverageLength .Name = "Simple Moving Average"; input_MovingAverageLength .SetInt(10); // this is the default moving average length return; } // Do Calculations if (something) { updatedMovingAverageLength[sc.Index] = input_MovingAverageLength.GetInt() + 5; // obviously 5.0f is incorrect also as I'm still mixing int and float values. } The issue is the the length is an integer (as usual); this is incremented by an integer ... but I'm having to store it in a float array. I do need array values not a Persistent Variable. How do I store it in the correct array type? ... or do I have to convert it back and forth from integer and float values each time before use? I expect there is a specific array type but I've tried data and could not achieve the outcome either? I know support doesn't help with programming but if you can provide some help/pointer it would be really helpful. Thank you |
To post a message in this thread, you need to log in with your Sierra Chart account: