Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
gsub command of macro language
Posted by: JohnHell
Date: May 01, 2005 10:49PM

Doesn't support variables as base strings?

I mean I have this:
=======
$stringfixed = gsub(25, , $imageurl);
alert($stringfixed);
=======

And the result of that is the alert showing the text "$imageurl" (without quotes) but if enter as string any text with the text to replace it does correctly.

Is a Macro Language lack or is me?

Options: ReplyQuote
Re: gsub command of macro language
Posted by: JohnHell
Date: May 01, 2005 11:24PM

If I use a concatenation dot then it takes the url but an error alert appears telling me that there were expected 3 elements but there where only 2. This is because it takes the comma of the third element as one. Is anyway to avoid that?

The truth is, is there any way to make the gsub, sub and gensub commands working with variables?

=======
$stringfixed = gsub(25, , .$imageurl);
alert($stringfixed);
=======

Options: ReplyQuote
Re: gsub command of macro language
Posted by: JohnHell
Date: May 01, 2005 11:38PM

Hehehe, again, ok found but.... why if you use a variable the 2 element can't be blank and if not it can be and works at blank space?

I fixed because the strings together to what i want to replace are ever the same and i can declarate a second element but, what must i do if my only one option could be to leave the second element blank?

This must be fixed if Ulf take again the development, of course.

Options: ReplyQuote
Re: gsub command of macro language
Posted by: rmn
Date: May 02, 2005 08:29AM

$stringfixed = gsub(25, "", $ImageURL);
alert($stringfixed);

Options: ReplyQuote
Re: gsub command of macro language
Posted by: JohnHell
Date: May 02, 2005 07:17PM

Yes I did, but maybe for some mistake ^_^' it didn't work hehe sorry hehehe smiling smiley

Options: ReplyQuote


K-Meleon forum is powered by Phorum.