263 posts
    Has been part of the Envato Community for over 6 years Located in Antarctica Has sold $100+ on Envato Market Has collected 1+ items on Envato Market
+1 more
x360c says

Lol, this one error just eludes me. Thanks in advance for the help.

Here’s my code:
/*Converts a string to be exported to PHP.*/
var php_insert:Function=function(input:String) {
var output:String = input;
var output = str_replace (output, '&', '/and/');
var output = str_replace (output, '?', '/que/');
var output = str_replace (output, '#', '/num/');
var output = str_replace (output, ':', '/colo/');
var output = str_replace (output, '%', '/perc/');
var output = str_replace (output, '/n/r', '/br/');
var output = str_replace (output, '/r/n', '/br/');
var output = str_replace (output, '/n', '/br/');
var output = str_replace (output, '/r', '/br/');
return (output);
};

/*Converts a string to be imported from PHP.*/
var php_extract:Function=function(input:String) {
var output:String = input;
var output = str_replace (output, '/and/', '&');
var output = str_replace (output, '/que/', '?');
var output = str_replace (output, '/num/', '#');
var output = str_replace (output, '/colo/', ':');
var output = str_replace (output, '/perc/', '%');
return (output);
};
And here’s my error(s):
Warning: 3596: Duplicate variable definition.

Which is called for every line with ‘var output’ in it.

3072 posts
    Has referred 50+ members Has sold $40,000+ on Envato Market Has collected 10+ items on Envato Market Had an item featured on Envato Market
+5 more
wickedpixel says

leave only one “var” declaration for the “output” variable; only the line “var output:String = input;” must have “var” in front

2309 posts
    Has been part of the Envato Community for over 6 years Has referred 10+ members Has sold $100+ on Envato Market Has been a beta tester for an Envato feature
+5 more
theflyingtinman says

You’re joking right?

I can see at least 16 separate definition of the var “output”

...you have to remove the “var” keyword from all but the first .. not just the variable type declaration. :p

263 posts
    Has been part of the Envato Community for over 6 years Located in Antarctica Has sold $100+ on Envato Market Has collected 1+ items on Envato Market
+1 more
x360c says

Oh, I am new and thought that all variables had to have ‘var’ in front, me es stupido.

215 posts
    Has been part of the Envato Community for over 6 years Has referred 1+ members Has sold $1,000+ on Envato Market Sells items exclusively on Envato Market
+1 more
Ziyad says

You live and learn, eh 360

263 posts
    Has been part of the Envato Community for over 6 years Located in Antarctica Has sold $100+ on Envato Market Has collected 1+ items on Envato Market
+1 more
x360c says

I live and learn alot I guess. About 90% of my posts are questions. =)

by
by
by
by
by
by