Lesson 9 - Preprocessors - page 2

 

mladen, thankyou for responding to my query. I really appreciate.

I can see now I did not clearly state my problem. I realised it is a matter of advancing the numbers. I guess I should have explained I also tried

if (StringLen(symbol_prefix = 1)){

Base = StringSubstr(Symbol(),1,3);

Quote = StringSubstr(Symbol(),4,3);

(and similar for StringLen = 2) (2,3 and 5,3)

but MetaEditor gives an error saying 'symbol_prefix' - constant cannot be modified.

So I figured I'm not doing it right and that's why I posted. This is how I learn best, with practical problems experienced.

 
Newton51:
mladen, thankyou for responding to my query. I really appreciate.

I can see now I did not clearly state my problem. I realised it is a matter of advancing the numbers. I guess I should have explained I also tried

if (StringLen(symbol_prefix = 1)){

Base = StringSubstr(Symbol(),1,3);

Quote = StringSubstr(Symbol(),4,3);

(and similar for StringLen = 2) (2,3 and 5,3)

but MetaEditor gives an error saying 'symbol_prefix' - constant cannot be modified.

So I figured I'm not doing it right and that's why I posted. This is how I learn best, with practical problems experienced.

Newton51

Change that line to this :

if (StringLen(symbol_prefix)== 1){

 

Thankyou so much mladen. This was the problem. As soon as I added the extra "=", it compiled without errors.

Reason: