What is Readline()

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

Hey folks, I know Fred is real busy so he still hasn't answered this one. He mentioned the ReadLine() command is useful for reading strings from a file but I don't see it in the documents or help system. Anyone know of it, how it works, parameters, arguments etc?? Pretty please?

ReadString appears to do nothing under WindowsXP except crash the compiler so this seems to be a viable alternative.

Hmm, what other commands are there that aren't int he docs?? (grin)

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.
Hey folks, I know Fred is real busy so he still hasn't answered this one. He mentioned the ReadLine() command is useful for reading strings from a file but I don't see it in the documents or help system. Anyone know of it, how it works, parameters, arguments etc?? Pretty please?

ReadString appears to do nothing under WindowsXP except crash the compiler so this seems to be a viable alternative.

Hmm, what other commands are there that aren't int he docs?? (grin)

Fangles
Hi Fangbeast.

When you try the ReadLine() command you get a compile error like "ReadLine() is not a function, an array, or a linked list" do you not? This means that there is no such command in the libraries. The ReadString() command is the PB equivialent of other languages ReadLine command so use this!

You say that ReadString crashes the compiler, does that mean that it doesn't compile at all or that the program you wrote crashes during runtime? You must se to it that a file really is open when you call ReadString() or your program will crash for sure. For examples how to use ReadString() se the Quake3Launcher example that comes with PB(under \Purebasic\examples\Quake3Launcher\). The same file can be downloaded from the PB site's download page.

If you have no luck with the above example it can be that WindowsXP isn't compatible with PB, you should note that PB only claims to work on win9x,win2000. If it indeed is a compatibility issue you have to ask Fred about this.

/Pupil
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

I have found that if the compiler crashes during a ReadString command, the string is either to long or has bad characters. If I use ReadData instead, all is fine!
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

Fangbeast wrote:
Hello pupil. Fred was the one who mentioned ReadLine()!! So he must be talking about phantoms right?? (grin.
I've tested ReadString in many different ways and each time, when you get to the ReadString step, the compiler crashes.
...
I guess you've tried to compile the Quake3Luncher examples and that it didn't work? Cause if that program doesn't work it's not a problem about invalid characters or too long strings, it's as you said a compatibility problem.

And yes the ReadLine() command is a phantom;)
You asked for some other undocumented commands, why not try:
sin(), cos(), sqr(). I think they're not in doc because of as of yet their precision is very poor.

Paul wrote:
I have found that if the compiler crashes during a ReadString command, the string is either to long or has bad characters. If I use ReadData instead, all is fine!
ReadData??? Never heard of, which version are you talking about, amiga, linux, windows? I get a compile error when i try that command on the windows version(2.50) i.e. "ReadData() is not a function, an array, or linked list"


By the way, so we get this straight, when you say that the compiler crash i assume you mean that you get a compiler error or does the compiler really crash? If you do the "compile and run" thing in the menu your program is first compiled and then it's run in debugg mode. If you get an error or crash when your program is running it's not a compile crash but a runtime error/crash. But if your system breaks when compiling your code i would call that a compile crash.
Hope these definitions helps us understand each other better;)



Edited by - pupil on 01 October 2001 15:51:08
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Sorry... my mistake.
I was thinking ReadNetworkString() and ReadNetworkData()
It seems when String doesn't work, Data always will.
I guess the similar command for file access would be ReadString() and ReadMemory()

When I refer to a crash it would be one of many thing: a visit from Dr.Watson, an error in PureBasic###.exe , some kind of ASM error that tells me to Mail the offending file, a PB is busy, can't compile error, or the PB editor just sits there saying "compiling" and has to be shut down with the task manager.

I use both WinNT and Win2000 so there is never a total system lockup like Win95/98/ME that needs a reboot.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

This seems very serious. Sorry, ReadLine() doesn't exists, I was thinking aboutReadString() (Hum, hum, Fred you even don't know your own function names ?? :) which does the same. About the compiler crash, tell if it's PBCompiler.exe which crashes or PureBasic#####.exe, it's not the same at all.
In one case, the parser/compiler crashes (because of a function ? I doubt of it), in the other case it's the runtime program which crash (more possible). Please ALWAYS send me the source which crashes, else I simply can't fix the bug. I want PureBasic be bug free. It's not a dream, it should become a reality, so please, report all the bugs you found (with sources).

Fred - AlphaSND
Post Reply