mIRC Homepage
Posted By: JAFO Timestamp problem using variables - 07/01/05 06:43 AM
I am trying to make a small script tha allows me to set all my colors to my pref. and i am stuck on the timestamp.
I have a dialog that allows me to choose colors for Hours , Mins. , Seconds , Brackets( [ :: ] ) , and AM/PM. I have 14 different timestamp choices ( [h:nn] , [hh:nn] , [hh:nn:ss] , etc. etc. etc. It works using variables but it has a flaw - [h:nn] becomes  $+ %Color14 $chr(91)  %Color5 h  %Color :  %Color7 nn  %Color14 $chr(93)  , but it returns 5 [  0 h  6 :  2 nn  5 ]  ........... as you can see theres a lot of spaces in that timestamp. And since its set up this way i have to write a line for each available timestamp choice using a seperate variable to store that choice ( thats what gives me the return of 5 [  0 h  6 :  2 nn  5 ]  ). So now my question is , is there a way to get around the spaces? Am i doing more work than i have to using variables this way? And if so what are my other options?
Posted By: LocutusofBorg Re: Timestamp problem using variables - 07/01/05 08:36 AM
Everywhere a space appears, insert a $+ in your code.

echo -a %x %y will return 5 4
exho -a %x $+ %y will return 54
Posted By: JAFO Re: Timestamp problem using variables - 07/01/05 01:28 PM
Ooops sorry, i thought i edited that.
I got an answer for it already , if i use ,'s in place of all spaces and enclose the timestamp like this $+(,%Colors14x,$chr(91),,%Colors5x,h,,%Colors16x,:,,%Colors7x,nn,,%Colors14x,$chr(93),)
it works fine , i just had to make my variables when set accept that they were double digit color codes , so /set 0 $+ %varname and that turns them into 00,01,02 etc. but thanks a lot!
© mIRC Discussion Forums