- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using a variable as a placeholder for greater/less than in iLogic
Is it possible to have a variable contain the logical operator ">" or "<" to pass through a function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I don't believe so as the variable would be a string and fail in the boolean conversion..
-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570
Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! I am sorry I am not sure I follow the request. Could you show an example of a variable containing logical operator? Isn't it an expression?
Many thanks!

Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I mean a variable that would take the place of the ">" or "<" in a comparison.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous wrote:
I mean a variable that would take the place of the ">" or "<" in a comparison.
I assumed you wanted to do something like this..
myNumber = InputBox("Enter a Number", "iLogic", "25")
mygator = "<"
If (24 & mygator & myNumber)
MessageBox.Show("greater than 24", "iLogic")
Else
MessageBox.Show("less than 24", "iLogic")
End If
-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570
Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Yes, something like that. That text results in a "conversion from string" error when I try to run it.
I have a function that includes an IF statement where it would be helpful to change the comparison operators between <, >, and = when the function gets called.
I'm getting around it right now by writing out all of the IF cases within a case-select structure and passing a numerical variable to jump straight to the right IF case.