has a bit of a problem...
What am I doing wrong here?
While Not AppTerminate() Local inp:String = InputA$("") If inp <> Null WriteStdout "~q" + inp + "~q" EndIf Delay 1 Wend Function InputA$( prompt$=">" ) Global status:Int = 0 Global str$,buf:Byte[1024],p:Int,n:Byte If status = 0 StandardIOStream.WriteString prompt StandardIOStream.Flush EndIf status = 1 If StandardIOStream.Read( Varptr n,1 )<>1 status=-1 If n=0 status=-1 If n=10 status=-1 If n=13 status=-1 buf[p]=n ; p:+1 If p<>buf.length status=-1 str:+String.FromBytes(buf,p) p=0 If status=-1 DebugLog "" If p str:+String.FromBytes(buf,p) Local tstr$ = str status=0 ; str$=Null ; p=0 ; n=0 ; buf=Null buf = New Byte[1024] Return str EndIf Return Null End Function
What am I doing wrong here?