Advertisement

10.03.2007 at 08:52AM PDT, ID: 22869595
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

How do I parse the string as a variable ?

Asked by nazzie303 in JavaScript

Tags: , ,

I have a page where I have a variable  --  $MSG$ -- that is set up with some value in  a different place (global file or something). When it becomes available to my page, it can possibly have various values with a delimiter and a number. Example: $MSG$ could be as follows (NOTE THAT the value of $MSG$ is not within quotes):
error_msg_1~~20

Now I also have an include file which would have defined the messages like below
error_msg_1 = "Your have more than {num} digits"

So what I want to do is
1) Split the $MSG$ such that I have   error_msg_1  and   20     separately as a string in two different variable. ex: part1 and part2.
2) Then wih using eval() with the part1  I get the actual message from include file.
something like  eval("part1")
3) Then using the replace I replace {num} in part1 WITH the part2  which in this case would be 20.

so my final string would say
"Your have more than 20 digits"

Now I cannot change anything in global flle or include file. So would have to manipulate what i get in $MSG$Start Free Trial
 
Keywords: How do I parse the string as a variable ?
 
Loading Advertisement...
 
[+][-]10.03.2007 at 09:36AM PDT, ID: 20008007

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 10:32AM PDT, ID: 20008453

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 11:04AM PDT, ID: 20008689

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 11:22AM PDT, ID: 20008822

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 12:19PM PDT, ID: 20009237

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: parse, string, variable
Sign Up Now!
Solution Provided By: frin
Participating Experts: 2
Solution Grade: A
 
 
[+][-]11.29.2007 at 08:55PM PST, ID: 20379951

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628