Re: [Gambas-user] Numeric operation between strings.

2010-11-08 Thread user
ok i see that it works like this. I just want to ensure how it works because i am writing a book about Gambas and i want to describe some things correctly. Thanks. On Mon, 2010-11-08 at 11:52 +0100, Doriano Blengino wrote: > user ha scritto: > > ok i see this but > > > > CStr(-19776) output is i

Re: [Gambas-user] Numeric operation between strings.

2010-11-08 Thread Doriano Blengino
user ha scritto: > ok i see this but > > CStr(-19776) output is it a string? > > for example i think there is difference between > > DIM sVar1="-19776" AS String > DIM iVar2=-19776 AS Integer > > why Gambas re-convert a string to integer again when see a + operator? > Because gambas has automat

Re: [Gambas-user] Numeric operation between strings.

2010-11-08 Thread user
ok i see this but CStr(-19776) output is it a string? for example i think there is difference between DIM sVar1="-19776" AS String DIM iVar2=-19776 AS Integer why Gambas re-convert a string to integer again when see a + operator? The statement PRINT CStr(-19776) + CStr(-19776) should be equal

Re: [Gambas-user] Numeric operation between strings.

2010-11-08 Thread Caveat
Well CStr(-19776) gives -19776 so if you use the arithmetic addition operator you're gonna get -19776 plus -19776 giving -39552. Using the arithmetic operator in this case only works if both your strings can be treated as floats, so this will raise an error: PRINT CStr(-19776) + CStr("W") If you

[Gambas-user] Numeric operation between strings.

2010-11-08 Thread user
Hi to all and good morning. I have this code PRINT CStr(-19776) + CStr(-19776) and i get -39552 How this is possible? Numeric operations between Strings? -- The Next 800 Companies to Lead America's Growth: New Video