cancel
Showing results for 
Search instead for 
Did you mean: 

SimTalk syntax bug when combining switch case and EventController.End

Creator
Creator

Dear all,

I think I have encountered a bug in the SimTalk syntax. I am trying to set the eventcontroller end time attribute in a switch case.
The example code below demonstrates the possible bug (in my real code there are many cases involved):

 

switch true
case true
	EventController.End := 10
case false
	EventController.End := 5
end

 

It is clear that this code should set the eventcontroller end time to 10. When I try to apply this code, i get a syntax error saying "Error in line 2: Constant of type real expected." .
I am pretty sure that SimTalk confuses the ".End" attribute of the EventController with the end of the switchcase. This can be proven if you fold this switch case as in the following picture:

 

CodeSnippet2.JPG

 

Am I doing something wrong? Or is this really a bug. If so, is there a workaround? I did not download the brand new update yet and I am running Tecnomatix Plant Simulation 13 (I try to avoid updates during the development of a large model).

 

Thank you in advance,
Seppe

2 REPLIES

Re: SimTalk syntax bug when combining switch case and EventController.End

Phenom
Phenom

have a closer look into the help file; you can use switch only for integer, real and string
For Boolean you can use a simple if condition.


Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net


Re: SimTalk syntax bug when combining switch case and EventController.End

Creator
Creator

Thank you for your reply, my code actually is with integers. I just made that code to illustrate what I thought the problem was. Although I must have made a mistake in my main code elsewhere it seems, as it indeed works when I try a simple example with integers. I was confused by the way the folding works.

My mistake

 

Seppe