String = Null

Please report bugs.

String = Null

Postby Slowdown » Sun Jan 20, 2013 9:49 am

When reading a String from Empty Dictionary the String is Null.
Is this correct ? shouldn't the String be empty ("") ?
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: String = Null

Postby Henning » Sun Jan 20, 2013 11:55 am

That is one of the "uninitialized" variable gotchas. I was caught by that earlier.

I remember I've seen that reading past end of a Dictionary IS returning a Null-string. My 5 cents is that it's some C++ spillover. There is a lot of C++ in the Q7b syntax...

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: String = Null

Postby Slowdown » Sun Jan 20, 2013 1:47 pm

Hi Henning,
reading past end of a Dictionary

In that case i understand it.
In VB6 (in the past) when i forced an application to read after the end of a randomfile created by the same application
it returned garbage.
In this case i do the following,
In Global
Code: Select all
Public Type TypeAppConfig
  SourceDir As String
  DestDir As String
  Priority As Integer
End Type

In some module when the file doesn't excist
Code: Select all
    Config.Priority = 3
    Config.SourceDir = ""
    Config.DestDir = ""

Save the value's and read them back.
The two string values shouldn't be Null in this case.
Edit::
Strings are indeed set to Null in the dictionary.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<V1.0>
    <dictionary>
        <key>SyncdirSettings</key>
        <type>
            <count>3</count>
            <null></null>
            <null></null>
            <integer>2</integer>
        </type>
    </dictionary>
</V1.0>
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: String = Null

Postby Henning » Sun Jan 20, 2013 2:20 pm

This smells like the known problem with Public Types in Global, and Arrays too...

My guess is that if the Type is declared in the same Module it will work. ;)

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: String = Null

Postby Slowdown » Mon Jan 21, 2013 8:02 pm

Will test this if i have some time.
At this moment i have an application with unexpected behavior and can't find the problem :evil:
Is there a place on the forum where i can shout a lot of nasty words, to curse so i can relieve me from some frustations :?
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: String = Null

Postby Slowdown » Tue Jan 22, 2013 8:29 pm

pfffff at last solved.
no it doesn't belong here sorry.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: String = Null

Postby Henning » Tue Jan 22, 2013 9:19 pm

:D

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron