Questions tagged [increment]
DO NOT USE THIS TAG ALONE. Use with a language tag like [javascript] or [python]. Adding one to the value of a variable, generally with the use of an increment operator.
increment
3,559
questions
-6
votes
1
answer
40
views
How do you increment a number made with an onclick (in html)? [closed]
function incrementValue() {
var value = parseInt(document.link('number').value, 10);
value = isNaN(value) ? 0 : value;
value++;
document.link('number').value = value;
}
<div class="link"&...
1
vote
2
answers
46
views
Why are these results different between two types code of Java? [duplicate]
First of all, my mother language is not English.
Now I study Increment(++) ande Decrement(--) operators of Java.
I tried an issue. But the result of mu code differents from my expectation.
Issue
...
1
vote
0
answers
19
views
Kotlin - how can I create a list of numbers between a range and stepped by a certain value [duplicate]
In Kotlin, I'm trying to create a val with a list of numbers within a specific range, incremented by 1.5. How can I do this? I've tried the below, but I'm getting an error with "step".
val ...
0
votes
3
answers
71
views
Decrement value MongoDB, prevent negative number
I'm using MongoDB and I have a document where I want to increment a count field. However, I need to ensure that this count does not go below zero. For example, if inc is -2 and the current count is 1, ...
0
votes
1
answer
18
views
Incrementing Key in Simple React To Do App
I have an incrementing key in my React To Do App so I can filter out certain tasks with an id identifier. For some reason, I have to declare and define my id outside of the main function. Why can't I ...
0
votes
2
answers
57
views
Autoincremental values for multiple columns in snowflake
is there a way to create sequence without any gaps in snowflake. I cannot use row number as I am running the updates/inserts multiple times which will end up creating same row numbers 1 to n on every ...
3
votes
3
answers
149
views
PHP 8 how to concisely increment dynamically generated variables
PHP 8 raised the Notice to a Warning that an unset variable/array key is worked on.
PHP 7.4:
// Below would create a variable and set it to 0 + 1
// Below would generate a Notice level error.
$...
0
votes
0
answers
34
views
How to auto increment name value in a HTML dinamic "+" form input
I have this HTML form and JavaScript to add a dinamic form input when I click the + button, how can I give an individual name to each input field? name="name1" name="email1", name=&...
0
votes
1
answer
16
views
Why is my angular datetimepicker adding increment/decrement text over arrows on input?
I can't figure out why my datetimepicker in my angular project is suddenly adding these weird lines of text over my arrows on the time input. They appear to be related to increment/decrement hours/...
0
votes
2
answers
96
views
C increment ++ unexpected result
I have a problem with using increment ++ while trying to increase the value of an int variable. I'm passing the address of the variable called records to the function open() than opens a file in ...
0
votes
0
answers
35
views
How to copy label with name - Visual Studio 2022
I created a new label. It came with "label1" name.
I changed the name "label1" to "myLabel1".
I'm copying this: "myLabel1"
When I paste it comes as: "...
0
votes
1
answer
22
views
Adding (increment) values to a record in Laravel or creating a new row
I want to say that if there is a row in the "ListingPoints" model where "ListingPoints" is equal to 1 and "review_cat_id" is equal to 1, then the value of "...
1
vote
1
answer
18
views
Why is the cart increment not working properly?
I need to increase or decrease the quantity of items on the cart, but when I click the increment button for a particular item, it increases the quantity of all the items in the cart.
Here's my code - ...
1
vote
1
answer
61
views
Variable in Python going up by more than 1 at a time
I am currently making a project for my school for fun, and I came across a problem. The project is a paddle and ball game, and every time the ball hits the paddle the score SHOULD go up by one, but ...
-1
votes
1
answer
45
views
Increment number on each node with excluding one
I'm trying to automatically name node number in tomcat server.xml on several nodes.
I have for that the playbook below:
vars:
- node_number: "{{ ansible_host_all.index(inventory_hostname) + 1 }}...