X is not valid?

X is not valid?

jletcher
Advisor Advisor
1,207 Views
10 Replies
Message 1 of 11

X is not valid?

jletcher
Advisor
Advisor

Hard to explain this but I wil do my best.

 

 Making a part that will have the size as an option to pick. Issue is Ilogic does not like it.

 

 I have a list that has sizes like:

3" X 2"

4" X 2"

4" X 4"

 

But when I put in the code

 

If Plate_Size = "3" X 2"" Then
	Parameter("Dim_X") = 3
	Parameter("Dim_Y") = 2
	Parameter("Foot_Code") = "A"

ElseIf Plate_Size = "4" X 2"" Then
	Parameter("Dim_X") = 4
	Parameter("Dim_Y") = 2
	Parameter("Foot_Code") = "B"

End If

 it gives me an error

Error on Line 4 : End of statement expected.

and highlight the If Plate_Size ="3" X 2"".

 

I know it has to do with the X but I an't remember what to do having brain fart.

 

 Can someone refresh me.....

0 Likes
Accepted solutions (2)
1,208 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable

I think the " marks are messing you up. iLogic will see the string as divided because the " will be seen as the start and end of a string.

0 Likes
Message 3 of 11

jletcher
Advisor
Advisor

Yes you are correct. Is there a way to keep them? I know it has to do with a double something if I remember correctly..

0 Likes
Message 4 of 11

Anonymous
Not applicable

My only solution is to go metric! lol... Sorry 🙂

 

0 Likes
Message 5 of 11

Anonymous
Not applicable
I can see a workaround where you'd make addition parameters that have the value 3" x 2" and then write the code to say if PlateSize = NewParameter then ect.... It's a fudge but it should work and keep you moving forward.
0 Likes
Message 6 of 11

jletcher
Advisor
Advisor

Metric lol that would flip these rednecks out they don't even know what a weld symbol is LOL.

 

 Yeah i was thinking the same thing about the new parameter I guess I will just take them out for now..

0 Likes
Message 7 of 11

Anonymous
Not applicable
Accepted solution

You should be able to put an 'extra' quotation mark in the string like this :

 

If Plate_Size = "3"" X 2""" Then
	Parameter("Dim_X") = 3
	Parameter("Dim_Y") = 2
	Parameter("Foot_Code") = "A"

ElseIf Plate_Size = "4"" X 2""" Then
	Parameter("Dim_X") = 4
	Parameter("Dim_Y") = 2
	Parameter("Foot_Code") = "B"

End If

 

(The extra quotation mark will be ignored when the rule is compiled and run)

 

Cheers,

Tom

Message 8 of 11

jdkriek
Advisor
Advisor
Accepted solution

Or you can use Chr(34) - less confusing programmatically IMO

 

If Plate_Size = "3" & Chr(34) & " X 2" & Chr(34) Then
	Parameter("Dim_X") = 3
	Parameter("Dim_Y") = 2
	Parameter("Foot_Code") = "A"
ElseIf Plate_Size = "4" & Chr(34) & " X 2" & Chr(34) Then
	Parameter("Dim_X") = 4
	Parameter("Dim_Y") = 2
	Parameter("Foot_Code") = "B"
End If
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 9 of 11

jletcher
Advisor
Advisor

Thanks that worked.. I thoght I tried that but I gues I did not..

0 Likes
Message 10 of 11

jletcher
Advisor
Advisor

Thanks jdkriek your solution will work too...

0 Likes
Message 11 of 11

jdkriek
Advisor
Advisor

Quite welcome! 😉

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes