Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Incrementing a String value, HELP!!!!!

1. ## Incrementing a String value, HELP!!!!!

I have a string value that I receive from a input box
("268435457412053869") I need to increment the value entered so basically the new value should be "268435457412053870" but QTP errors when I try to do the addition. I tried converting the string to another type but received stackflow errors. Is there a simple way to do this? [img]/images/graemlins/confused.gif[/img] <font color="red"> </font> HELP!!!

2. ## Re: Incrementing a String value, HELP!!!!!

Try to do this and then try addition
iValue = Cdbl("268435457412053869")then u'r required number is iValue +1.

3. ## Re: Incrementing a String value, HELP!!!!!

To expand on what's happening there you simply exceeded the size that an Integer or String or even a Long could handle. So you would need to convert to a double in order to operate arithmetic on it.

[ QUOTE ]

Byte 1 byte 0 to 255

Boolean 2 bytes True or False

Integer 2 bytes -32,768 to 32,767

Long
(long integer) 4 bytes -2,147,483,648 to 2,147,483,647

Single
(single-precision floating-point) 4 bytes -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values

Double
(double-precision floating-point) 8 bytes -1.79769313486231E308 to
-4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values

Currency
(scaled integer) 8 bytes -922,337,203,685,477.5808 to 922,337,203,685,477.5807
Decimal 14 bytes +/-79,228,162,514,264,337,593,543,* 950,335 with no decimal point;
+/-7.9228162514264337593543950335 * with 28 places to the right of the decimal; smallest non-zero number is
+/-0.0000000000000000000000000001 *

Date 8 bytes January 1, 100 to December 31, 9999
Object 4 bytes Any Object reference

String
(variable-length) 10 bytes + string length 0 to approximately 2 billion

String
(fixed-length) Length of string 1 to approximately 65,400

[/ QUOTE ]

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.