blitzmax and text files

BlitzMax Forums/BlitzMax Programming/blitzmax and text files

ckob(Posted 2005) [#1]
ok im lost with something that should be simple.

I have a text file in this format

Name
25000
1

the text file is made in blitz3d using
writeline but when I try to use this code in bmax

ServerConfigFile = OpenStream("Server.con")
Server_Name$ = ReadLine(ServerConfigFile)
Server_Port = ReadLine(ServerConfigFile)
logstatus = ReadLine(ServerConfigFile)
CloseStream(ServerConfigFile)
it spits out this error [unable to convert string to int]

I'm not sure why.


McFox(Posted 2005) [#2]
change this :
Server_Port = ReadLine(ServerConfigFile)
by this :
Server_Port = Int(ReadLine(ServerConfigFile))

EDIT :

And
logstatus = ReadLine(ServerConfigFile)
by this
logstatus = Int(ReadLine(ServerConfigFile))


ckob(Posted 2005) [#3]
thank that worked perfect.


McFox(Posted 2005) [#4]
You're welcome