string time1 = "timeperiod1",time2 = "timeperiod2",time3 = "timeperiod3",time4 = "timeperiod4", time5 = "timeperiod5",time6 = "timeperiod6",time7 = "timeperiod7",time8 = "timeperiod8",time9 = "timeperiod9", time10 = "timeperiod10"; string times[10]; times[0]= time1; times[1]= time2; times[2]= time3; times[3]= time4; times[4]= time5; times[5]= time6; times[6]= time7; times[7]= time8; times[8]= time9; times[9]= time10;
Strings are in double quotes "";
Unless your copying one string variable into another but you are not showing any other string values for timeperiod1 - timeperiod10
thanks for the reply,
all the timeperiods are variables not values, so they contain other values
In that case you need to let the compiler know that you have reached the end of a command by placing a semicolon.
So when you try to copy variables that won't work with a comma.
string time1 = timeperiod1; string time2 = timeperiod2; string time3 = timeperiod3; string time4 = timeperiod4; string time5 = timeperiod5; string time6 = timeperiod6; string time7 = timeperiod7; string time8 = timeperiod8; string time9 = timeperiod9; string time10 = timeperiod10;
In that case you need to let the compiler know that you have reached the end of a command by placing a semicolon.
So when you try to copy variables that won't work with a comma.
ok wil try, thanks
ok wil try, thanks
Still doesnt work.
string time1 = timeperiod1; string time2 = timeperiod2; string time3 = timeperiod3; string time4 = timeperiod4; string time5 = timeperiod5; string time6 = timeperiod6; string time7 = timeperiod7; string time8 = timeperiod8; string time9 = timeperiod9; string time10 = timeperiod10; string times[10]; times[0]= time1; times[1]= time2; times[2]= time3; times[3]= time4; times[4]= time5; times[5]= time6; times[6]= time7; times[7]= time8; times[8]= time9; times[9]= time10;
Did that and i still got the same error
Still doesnt work.
Did that and i still got the same error
Ok i fixed it using a dynamic array and a loop to fill !
Worked. Thanks
Im having issues with an array that will constantly return compiler error for this array.
Everything is string , I tried multiple ways, but seems to not work
- Don't state the error and where. There are no mind readers here and our crystal balls are cracked.
- "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here and our crystal balls are cracked.
Same statement, same answer.
Ok i fixed it using a dynamic array and a loop to fill ! Worked. Thanks
You're welcome but no one but you knows what the problem was and what you did.
- Don't state the error and where. There are no mind readers here and our crystal balls are cracked.
- "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here and our crystal balls are cracked.
Same statement, same answer.
You're welcome but no one but you knows what the problem was and what you did.
Hi, Thanks for your reply.
The error i mentioned in the headline, and i thought it was enough. By doesnt work i meant receiving the same error, and i believe you understood that
Hi,
Im having issues with an array that will constantly return compiler error for this array.
Everything is string , I tried multiple ways, but seems to not work
times[0]= time1; times[1]= time2; times[2]= time3; times[3]= time4; times[4]= time5; times[5]= time6; times[6]= time7; times[7]= time8; times[8]= time9; times[9]= time10;
You can't assign value on the global scope. It needs to be in a function.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Im having issues with an array that will constantly return compiler error for this array.
Everything is string , I tried multiple ways, but seems to not work