473,324 Members | 2,548 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,324 software developers and data experts.

increment a var

mickey0
142 100+
Expand|Select|Wrap|Line Numbers
  1.  for (var i in data.value.items) { 
  2.    Number = "<b><i> Number: " + (i +1) + "</i></b><br /><br />";
  3. }
  4.  
Hi, I have this code, but I need augmenting by "1" the result; in my output web page appear:
01
11
21
31
41
......
How to solve? thanks...
Jan 24 '08 #1
3 1173
r035198x
13,262 8TB
Expand|Select|Wrap|Line Numbers
  1.  for (var i in data.value.items) { 
  2.    Number = "<b><i> Number: " + (i +1) + "</i></b><br /><br />";
  3. }
  4.  
Hi, I have this code, but I need augmenting by "1" the result; in my output web page appear:
01
11
21
31
41
......
How to solve? thanks...
What are you trying to display? The data items numbered from 0 upwards?
If that is the code that produced that output, then why was "Number" not printed as well?
Perhaps if you explain further what you want to do and post more of the code you are using( in code tags).
Jan 24 '08 #2
mickey0
142 100+
hello,
I want:
1
2
3
4
and not
01
11
21
31
41
Jan 24 '08 #3
gits
5,390 Expert Mod 4TB
hi ...

i guess that i is a string so try:

Expand|Select|Wrap|Line Numbers
  1. for (var i in data.value.items) { 
  2.     Number = "<b><i> Number: " + (parseInt(i, 10) + 1) + "</i></b><br /><br />";
  3. }
kind regards
Jan 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mark Turney | last post by:
I was reading "Practical C++ Programming" yesterday, and it mentioned that the order of execution for post-increment and post-decrement operators was ambiguous. I had previously learned that a...
8
by: lovecreatesbeauty | last post by:
Hello experts, Why can this difference between prefix increment/decrement and postfix increment/decrement reside in built-in operators for built-in data types? Thanks. // test.cpp // //...
2
by: Tom | last post by:
I am trying to store information into a table that has an auto increment field. There is currently no data in the table. Using the code below I cannot insert data into the table. I get an error...
13
by: kailasam | last post by:
Hello, Iam having a doubt. Which is more efficient post increment or Pre increment? I have read that preincrement is efficient than Post increment. Iam not able to think how it is? For an...
1
by: Krish | last post by:
Is it true that I cannot increment in decimals, I would like to increment the control by .25 thanks
3
by: George Ter-Saakov | last post by:
What is the purpose of having Interlocked.Increment if it does not work with variable declared as volatile. Here is my problem, Interlocked.Increment increments the variable in thread safe...
2
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I...
15
by: Ryan Liu | last post by:
Hi, Is there any known bug related to Interlocked.Increment(ref var)? My client report var's value going up and down in the client/server multile-thread application. There are about 80...
11
by: divya_rathore_ | last post by:
The code: int aaa = 100; printf("%d %d %d\n", --aaa, aaa, aaa--); printf("%d\n", aaa); prints: 99 100 100 98
8
by: bintom | last post by:
Why doe the following C++ code behaves as it does? int i; i=1; cout << (++i)++; Output: 2 i=1; cout << ++(++i); Output: 3 i=1; cout << (i++)++; Output: Error. LValue required...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.