BluMan 0 Newbie Poster

Hi!
Could you tell me what did I do wrong in the code bellow? I try to read one line from a file, but it shows on the screen only unknown characters(different from the characters I have in the file).

GetLine Proc Hand:HANDLE, pBuf:DWord
		Local Len:DWord
		Local rLen:DWord
		Local Chr:Byte
		Mov Len, 0
		.Repeat
			Mov rLen, 0
			Invoke ReadFile, Hand, Addr Chr, 1, Addr rLen, NULL
			Invoke StdOut, Addr Chr
			Mov Ebx, Len
			Mov Ah, Chr
			Mov Byte Ptr [pBuf+Ebx], Ah
			Inc Len
		.Until Chr == 10 || Chr == 0
		Mov Byte Ptr[pBuf+Ebx], 0
		Mov Eax, Len
		Ret
	GetLine EndP

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.