Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / Strings Problem.... Not good

Author
Message
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 5th Apr 2005 01:01 Edited at: 5th Apr 2005 01:05
Run this code in 5.8...



Oh dear... How can they both test true? I spent the good part of 2 hours finding this bug. You can fix it by initialising the string...



But I always thought DBPro set strings to null automatically. This worked perfectly before the upgrade, and it should really work now.

Isn't it? Wasn't it? Marvellous!
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 5th Apr 2005 02:39
Not too good is it.

Personally though, I would prefer that DBPro did not allow variables that aren't initialised at all. Code seems much clearer to understand if variables are set with values first.

I wouldn't dream of doing something like:



Boo!
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 5th Apr 2005 02:44
Unfortunately its due to the way strings are initialised (or not as the case may be).

As Spooky says, it would be good if variables had to be initialised. In the mean time, make sure you do it yourself.

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 5th Apr 2005 07:16
Yeah, I agree, I try to initialize strings as often as I can, good practise really.

Isn't it? Wasn't it? Marvellous!
Tartopom
19
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 5th Apr 2005 23:32
Hello,



works without initialisation . A problem with <> operator ?
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 6th Apr 2005 01:43
Yes it is. A combination of un-initialised strings and the <> operator. Obviously if (str = "") produces a 1, not (str = "") will produce the opposite (basic logic). But I realise you already knew that, just pointing out that its a problem when you combine the two.

Isn't it? Wasn't it? Marvellous!
Tartopom
19
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 6th Apr 2005 03:02
Will we have to wait for the next update before having this fixed? ( and other minor bugs).

I'm not very happy to change my code on each patch .
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Apr 2005 06:38
You shouldn't need to change anything - should always make sure variables are initialised before using them.

Tartopom
19
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 7th Apr 2005 02:19
For me there's with that when I'm using bluegui even with the initialisation. This code don't works for me :

Tartopom
19
Years of Service
User Offline
Joined: 27th Jun 2004
Location:
Posted: 11th Apr 2005 23:53
Works fine with 5.8 Public Release.
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 1st Oct 2005 14:43
Bump for bug fix

Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Oct 2005 17:07
Tested this in 5.9 and no problems with either initial code sections posted.

Login to post a reply

Server time is: 2024-04-20 10:54:45
Your offset time is: 2024-04-20 10:54:45