473,232 Members | 1,586 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,232 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 1307
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.