473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Dynamic Variable ?

Hi all,

hopefully someone knows the answer to this one !

Im trying to use something like this...
>var riders = dropriders.split(",");

for (x in riders)
{
var shebang = strvalue.concat("rider" , riders[x]);
value += rPrice[document.myteam.shebang.value];
}
dropriders can be from one to ten elements looking something like --1,2,6

Therefore in the value += line, i would want shebang to be replaced by
rider1, rider2, rider6.

Any thoughts ?

Thanks in advance,

Leon
May 10 '07 #1
2 1311
On May 11, 8:10 am, Leon <l...@dontcallmeeeore.co.ukwrote:
Hi all,

hopefully someone knows the answer to this one !
The FAQ does...

Im trying to use something like this...
>var riders = dropriders.split(",");
>>
>for (x in riders)
>{
>var shebang = strvalue.concat("rider" , riders[x]);
>value += rPrice[document.myteam.shebang.value];
>}

dropriders can be from one to ten elements looking something like --1,2,6

Therefore in the value += line, i would want shebang to be replaced by
rider1, rider2, rider6.

Any thoughts ?
<URL: http://www.jibbering.com/faq/#FAQ4_39 >
--
Rob

May 10 '07 #2
In comp.lang.javascript message <4643986b$0$8711$ed2619ec@ptn-nntp-
reader02.plus.net>, Thu, 10 May 2007 23:10:51, Leon
<le**@dontcallmeeeore.co.ukposted:
>>var shebang = strvalue.concat("rider" , riders[x]);
value += rPrice[document.myteam.shebang.value];
>Therefore in the value += line, i would want shebang to be replaced by
rider1, rider2, rider6.
FAQ 4.25 provides the necessary clue. FAQ 4.39 is better. They should
be merged, or at least consecutive.

The example in 4.39, while valid, is pointless; there should also be an
example with a variable string, such as "Item"+N. I can see no point in
using bracket notation where the string is a constant known at code-
writing time.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
May 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: Martin Hart - Memory Soft, S.L. | last post by:
Hi all: I still very new to the .NET world and don't know if what I am asking is due to an over-imaginative imagination or the fact that I have read too many fiction books!! Let me show you a...
28
by: Dennis | last post by:
I have a function which is called from a loop many times. In that function, I use three variables as counters and for other purposes. I can either use DIM for declaring the variables or Static. ...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
2
by: Luis Arvayo | last post by:
Hi, In c#, I need to dynamically create types at runtime that will consist of the following: - inherits from a given interface - will have a constructor with an int argument
24
by: Ken | last post by:
In C programming, I want to know in what situations we should use static memory allocation instead of dynamic memory allocation. My understanding is that static memory allocation like using array...
7
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
14
by: vivek | last post by:
i have some doubts on dynamic memory allocation and stacks and heaps where is the dynamic memory allocation used? in function calls there are some counters like "i" in the below function. Is...
1
by: lumumba401 | last post by:
Hello everybody, i am asking about how to define a bidimensional dynamic array as a global variable to use as incoming variable in a function Let us see , for example in a part of a programm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.