ObjectCreate / ObjectSet - Changing ObjectCreate Properties and Colour?

 

I know I'm obviously doing this wrong. I can't work out how ObjectSet works with changing the properties of ObjectCreate?

bool Short_Line = ObjectCreate("First Short Target", OBJ_HLINE, 0, 0, FirstTarget_Sell);
                  if( Short_Line == True)
                     {
                      bool Short_Line_Edit = ObjectSet("First Short Target", STYLE_DASHDOT, FirstTarget_Sell);
                     }

Wanting to choose STYLE_DASHDOT and changing the colour? I have got it working in terms of just a horizontal red line where and when I want it (as well as deleting it when I want it deleted too). Just stuck with editing its properties.

 

just check the help (press F1 when you select ObjectSet)

bool ObjectSet( string name, int index, double value)
   name   -   Object name.
   index   -   Object value index. It can be any of Object properties enumeration values. 
   value  -   New value of the given property. 

clicking for more info on "object properties" you see:

OBJPROP_STYLE 7 int Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object line style. 

e.g.

ObjectSet("First Short Target", OBJPROP_STYLE, STYLE_DASHDOT)

Honestly. I've never done that before.. I just looked in the help and pasted the answer. You should do the same instead of asking here.

 
bool ObjectSet( string name, int index, double value) 
Changes the value of the specified object property. If the function succeeds, the returned value will be TRUE. Otherwise, it will be FALSE. To get the detailed error information, one has to call the GetLastError() function. 
See also ObjectGet() function. 
Parameters:
name   -   Object name. 
index   -   Object value index. It can be any of Object properties enumeration values. 
value   -   New value of the given property. 
 
"Value" - as far as I was concerned, was the value where the object will be changed too (i.e. price / movement of that object). I personally perceived "STYLE_DASHDOT" as a property... not a value...

So although I press F1 on everything, sometimes it is not that clear to me.


thanks for helping.
Reason: