I have one question about create methods by another methods.
I am trying to create method by drag and drop .
I am using this method
obj : object;
-- @,?: drop target
for local i := 1 to draggedObjects.dim loop
obj := draggedObjects[i];
-- enter your source code here
"if @.istractor=true then"+
Problem is that created method is written in one row it doesnt format as i want.
Created method:is do if @.istractor=true then@.speed:=@.rychlost_zakruta;end;end;
How can I format created method?
I split method in several rows.
I didnt find any operator that will move code in another row
I am sending also model in 11,3.
Thanks for helping me
Solved! Go to Solution.
you can use ascii characters when you want to write on a new line and/or tab:
So it is:
obj.program:= "is "+chr(10)+ "do "+chr(10)+ chr(9)+"if @.istractor=true then"+chr(10)+ chr(9)+chr(9)+"@.speed:=@.rychlost_zakruta;"+chr(10)+ chr(9)+"end;"+chr(10)+ "end; "
There is also another way to achieve this, using a backslash at the line end inside a string:
obj.program := "is\ do\ if @.istractor then\ @.speed:=@.rychlost_zakruta;\ end;\ end;";