ObjectCreate works in init but not start

Back to topics list To post a new topic, please log in or register
Dessius 2015.06.29 00:01
Just like the subject says, I can create an object fine in init but if I try it in start I get nothing. I'm playing around with the FX Multi Meter II code and was wondering if there is something that might be preventing it from being created but I can't find anything. I've tried it in all different locations within the start function and still get nothing.
GumRai 2015.06.29 01:37 #

Difficult without seeing the code.

What error report are you getting?

Possibly, if you have already created the object, you cannot create a new object with the same name unless you delete the first one. 

Dessius 2015.06.29 03:40 #
I am using the following code to create the object which I use in all my programs to debug certain variables, the main body of the start function is about 700 lines so IDK if it will fit.
      ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("ObjName","Open Trade: "+OpenTrade+" Position: "+Position+" Arrow: "+ArrowUp+ArrowDown+" Strength: "+Strength+" Error:"+GetLastError(),25, "Verdana", Red);
      ObjectSet("ObjName", OBJPROP_CORNER, 0);
      ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
      ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
WHRoeder 2015.06.29 18:59 #
Don't call GetLastError (_LastError) unless you have an error. Your snippet is showing the ObjectCreate error which will always fail after the first tick.
Back to topics list  

To add comments, please log in or register