263 posts
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
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.

3069 posts
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
  • Romania
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
  • Beta Tester
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • United States
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
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
x360c says

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

215 posts
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
Ziyad says

You live and learn, eh 360

263 posts
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
x360c says

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

by
by
by
by
by
by