By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,189 Members | 2,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,189 IT Pros & Developers. It's quick & easy.

Problems with structures and strings

P: n/a
Hi

I am having a strange problem with a structure and fixed string:

in the structure definition i have:
structure gamedefinitionfile
:
<VBFixedString(20)Dim namegame As String

:

end structure

form code:

'in my code, i open the file (which may not exist)

Dim gamedef As gamedefinitionfile

FileOpen(fileno, gamedeffile, OpenMode.Random, OpenAccess.ReadWrite,
OpenShare.Shared, reclen)

FileGet(fileno, gamedef, 1)

If gamedef.namegame = "" Then

' problem is this never seems to get executed, ie it is never recognised as
null. But when i use a stop statement to check the value it shows as ""

end if

i have tried setting gamedef.namegame = "" before the fileget to no effect

i have tried trim(gamedef.namegame) = "" to no effect

Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"John" <no***************@nothing.comschrieb
Hi

I am having a strange problem with a structure and fixed string:

in the structure definition i have:
structure gamedefinitionfile
:
<VBFixedString(20)Dim namegame As String

:

end structure

form code:

'in my code, i open the file (which may not exist)

Dim gamedef As gamedefinitionfile

FileOpen(fileno, gamedeffile, OpenMode.Random, OpenAccess.ReadWrite,
OpenShare.Shared, reclen)

FileGet(fileno, gamedef, 1)

If gamedef.namegame = "" Then

' problem is this never seems to get executed, ie it is never
recognised as
null. But when i use a stop statement to check the value it shows as

Can never be null. Maybe Nothing. Null is something else dealing with
database (DBNull.Value)
""

end if

i have tried setting gamedef.namegame = "" before the fileget to no
effect

i have tried trim(gamedef.namegame) = "" to no effect
What does
gamedef.namegame is Nothing
say?

If it returns False, what does
gamedef.namegame.length
return?
Armin

Jun 27 '08 #2

P: n/a
I've never used that tag, but perhaps the <VBFixedString(20)tag is forcing
your string to 20 characters long?

--
David Streeter
Synchrotech Software
Sydney Australia
"Armin Zingler" wrote:
"John" <no***************@nothing.comschrieb
Hi

I am having a strange problem with a structure and fixed string:

in the structure definition i have:
structure gamedefinitionfile
:
<VBFixedString(20)Dim namegame As String

:

end structure

form code:

'in my code, i open the file (which may not exist)

Dim gamedef As gamedefinitionfile

FileOpen(fileno, gamedeffile, OpenMode.Random, OpenAccess.ReadWrite,
OpenShare.Shared, reclen)

FileGet(fileno, gamedef, 1)

If gamedef.namegame = "" Then

' problem is this never seems to get executed, ie it is never
recognised as
null. But when i use a stop statement to check the value it shows as


Can never be null. Maybe Nothing. Null is something else dealing with
database (DBNull.Value)
""

end if

i have tried setting gamedef.namegame = "" before the fileget to no
effect

i have tried trim(gamedef.namegame) = "" to no effect

What does
gamedef.namegame is Nothing
say?

If it returns False, what does
gamedef.namegame.length
return?
Armin

Jun 27 '08 #3

P: n/a

"SurturZ" <su*****@newsgroup.nospamwrote in message
news:46**********************************@microsof t.com...
I've never used that tag, but perhaps the <VBFixedString(20)tag is
forcing
your string to 20 characters long?

--
David Streeter
Synchrotech Software
Sydney Australia
"Armin Zingler" wrote:
>"John" <no***************@nothing.comschrieb
Hi

I am having a strange problem with a structure and fixed string:

in the structure definition i have:
structure gamedefinitionfile
:
<VBFixedString(20)Dim namegame As String

:

end structure

form code:

'in my code, i open the file (which may not exist)

Dim gamedef As gamedefinitionfile

FileOpen(fileno, gamedeffile, OpenMode.Random, OpenAccess.ReadWrite,
OpenShare.Shared, reclen)

FileGet(fileno, gamedef, 1)

If gamedef.namegame = "" Then

' problem is this never seems to get executed, ie it is never
recognised as
null. But when i use a stop statement to check the value it shows as


Can never be null. Maybe Nothing. Null is something else dealing with
database (DBNull.Value)
""

end if

i have tried setting gamedef.namegame = "" before the fileget to no
effect

i have tried trim(gamedef.namegame) = "" to no effect

What does
gamedef.namegame is Nothing
say?

If it returns False, what does
gamedef.namegame.length
return?
Armin

That is true - i've had to do a work around instead by setting it to
something then testing for that

Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.