mIRC Homepage
Posted By: Fantas Changing variable - 13/06/06 11:15 PM
i'm trying to write stuff to a text file and have it like this <p align= the align part i need to always be left then center then right.
i have tried var %align = left
if (%align == left) { %align == center}
if (%align == center) (%align == right }
it always comes out different and not like i want, how do i set it?
Posted By: MikeChat Re: Changing variable - 14/06/06 12:12 AM
just curious, are you usding mIRC to write a webpage?
Or are you trying to format text in mIRC?
Posted By: Fantas Re: Changing variable - 14/06/06 12:42 AM
it's just a page. I can get it to align if i write it like align=left but i need to change the align variable each time
Posted By: MikeChat Re: Changing variable - 14/06/06 01:06 AM
I guess my point was that there is no "align" in mIRC, and if you are trying to format text in the mIRC windo you will have to come up with a different way to do it.

to say "its just a page" tells me nothing
Posted By: DaveC Re: Changing variable - 14/06/06 05:24 AM
how about u show us some REAL code, then we might be able to help, at least the section of code u think are important.

PS: the code u showed wasnt ever valid, line 2 uses ( instead of { and %align is attached to the incorrect (
Posted By: Fantas Re: Changing variable - 14/06/06 06:54 AM
ok
write htm.txt <p align=" $+ %align $+ ">

all i want to do is change %align to left, then to center then to right and always in that succession. like if it uses %align left to change it to %align center if it uses %align center change it to %align right , if it uses %align rightchange to %align left
Posted By: hixxy Re: Changing variable - 14/06/06 09:32 AM
Short:

Code:
%align = $gettok(left center right,$iif($calc($findtok(left center right,%align,32) + 1) &lt; 4,$v1,1),32)


Long:

Code:
if (%align == right) %align = left
elseif (%align == left) %align = center
elseif (%align == center) %align = right
Posted By: Fantas Re: Changing variable - 14/06/06 05:41 PM
thanks Hixxy
Posted By: DaveC Re: Changing variable - 14/06/06 10:09 PM
hehe now i actually understand what he wanted, there is also the very short one of...

%align = $replacex(%align,right,left,left,center,center,right)
© mIRC Discussion Forums