PDA

View Full Version : + ?



Idan
April 9th, 2003, 04:22 AM
:eye: hiii

When I write a simple code like

a = b-1;

It's work, but when I wrote

a = b+1;

the 1 added near to the b...


For exaample:
if a = 10 then b =11...

What I need to write for get the + value?
Thanks!:battery:

blah-de-blah
April 9th, 2003, 06:12 AM
wait what do you mean? do you mean the b+1 doesnt' work? If thats whats wrong then i don't know whats wrong :(

Idan
April 9th, 2003, 08:03 AM
No, instead to do b+1 it's do b and 1

if b =10
it do b+1= 101

Here file with the problem:

senocular
April 9th, 2003, 08:23 AM
thats only if b is a string. the + operator is the addition operator for numbers and the concat for strings. So if you have a 'number' thats actually a string, you'll have to convert it to a number if you want to add its number value to another number ie

newVal = number(b) + 1

Idan
April 9th, 2003, 08:26 AM
Work!
thanks! C:-)