Platforms to show: All Mac Windows Linux Cross-Platform

Back to StdinMBS class.

StdinMBS.Echo as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Files MBS Util Plugin 17.4 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Enables/disables echo for stdin.
Example
// try this on Mac/Linux GUI/Console app with the app launched from Terminal,
// or in console app on Windows launched from command prompt

dim s as new StdoutMBS

s.Write "Hello World"+chr(10)

dim t as string
dim n as integer = StdinMBS.ReadString(t)
s.Write chr(10)
s.Write "Read with echo: "+t+chr(10)

StdinMBS.Echo = false

n = StdinMBS.ReadString(t)
s.Write chr(10)
s.Write "Read without echo: "+t+chr(10)

StdinMBS.Echo = true

You can disable echo for password input.
By default it is enabled.
(Read and Write property)

StdinMBS.IsReady as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property Files MBS Util Plugin 12.3 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Checks whether there is data waiting in input buffer to be read.
Example
Dim d As New date

Do
// print time if second changed
Dim e As New date
If e.Second <> d.Second Then
Print e.LongTime
d = e
End If

// if ready, read a key
If StdinMBS.IsReady Then
Dim s As String
Dim l As Integer = StdinMBS.ReadString(s)
Print "Input "+Str(l)+": "+s
End If
Loop

If IsReady returns false and you would call ReadString method, the app could be blocked until user types something on console.
Added Windows support in version 20.5. We return true, if there is a return in the input buffer, so you can call Read() functions.
(Read only property)

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...