Message 1 of 3
Convert string to variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I created the following constant in iLogic to later pass values on to Excel:
Const COLUMN_InstanceID As String = "A"
Const COLUMN_InstanceName As String = "B"
Const COLUMN_ProductType As String = "C"
Const COLUMN_Description As String = "D"
Const COLUMN_DesignType As String = "E"
Const COLUMN_GroupNumber As String = "F"
Const COLUMN_SerialNumber As String = "G"
Const COLUMN_Area As String = "H"
Const COLUMN_Zone As String = "I"
Const COLUMN_SequenceID As String = "J"
Const COLUMN_CustomerID As String = "K"
Const COLUMN_Phase As String = "L"
Const COLUMN_UsableWidth As String = "M"
Now I have the following code to lookup a parameter value that then has to be put in a specific cell in the Excel file:
i = 0
For Each oString In NumericList
For Each oPartUserParam As UserParameter In oPartUserParams
If oPartUserParam.Name = NumericList.Item(i)
'parameter found
FeedValue = oPartUserParam.Value
If oPartUserParam.Units = "degree" Then
FeedValue = Round(UnitConversion(FeedValue, oPartUserParam), 2)
Else
FeedValue = Round(UnitConversion(FeedValue, oPartUserParam), 0)
End If
GoTo FoundNumeric
End If
Next
FoundNumeric :
SetValueInExcel("COLUMN_" + NumericList.Item(i), Row.ToString, FeedValue)
'reset FeedValue
FeedValue = "N/A"
i = i + 1
Next
The problem I am having is that
"COLUMN_" + NumericList.Item(i)
results in (for example) COLUMN_UsableWidth2 instead of just "M". In short: I need the constant and not the entire string. Is there a way to convert a string to a variable?