[Implemented] OpenFile() Binary

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] OpenFile() Binary

Post by BackupUser »

Restored from previous forum. Originally posted by pbdep.


Hello PB Team,

Support for Console mode (Windows and LINUX!)

Is the folowing an option in PB?

OpenFile(stdio,#myconsole$)
WriteString("ESC[32;mThis would be nice")

The above write Binary to the stdio. ASNI is an example but could
be anything usefull in binary.

Hope its an Idea.

Greetings,
Norman.
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 tinman.
Originally posted by pbdep

The above write Binary to the stdio. ASNI is an example but could
be anything usefull in binary.
Have you tried something like this?

OpenConsole()
PrintN("ESC[32;mThis would be nice")


Also, don't Windows and Linux have a special console file handler? You could try using somethng like:

; For Windows
OpenFile(#myconsole, "CON:")
WriteString("ESC[32;mThis would be nice")

; For Linux
OpenFile(#myconsole, "/dev/tty0")
WriteString("ESC[32;mThis would be nice")

I doubt the device names are correct though.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)
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 pbdep.
Originally posted by tinman
Originally posted by pbdep

The above write Binary to the stdio. ASNI is an example but could
be anything usefull in binary.
Have you tried something like this?

OpenConsole()
PrintN("ESC[32;mThis would be nice")


Also, don't Windows and Linux have a special console file handler? You could try using somethng like:

; For Windows
OpenFile(#myconsole, "CON:")
WriteString("ESC[32;mThis would be nice")

; For Linux
OpenFile(#myconsole, "/dev/tty0")
WriteString("ESC[32;mThis would be nice")

I doubt the device names are correct though.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)
Hi tinman,

I tried, but dont seem to get it working overhere on windows
probably someting i do wrong or PB does not support
the opening of CON or PRN ? would be strange by the way...

Ill keep on trying :wink:
Norman.
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 tinman.
Originally posted by pbdep

I tried, but dont seem to get it working overhere on windows
probably someting i do wrong or PB does not support
the opening of CON or PRN ? would be strange by the way...
Perhaps my suggestion was a poor one. I thought CON: (or something like that) was a standard device under Windows. Maybe not.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)
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 pbdep.
Originally posted by tinman
Originally posted by pbdep

I tried, but dont seem to get it working overhere on windows
probably someting i do wrong or PB does not support
the opening of CON or PRN ? would be strange by the way...
Perhaps my suggestion was a poor one. I thought CON: (or something like that) was a standard device under Windows. Maybe not.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.40)

I must have been sleeping :wink:

This works fine ->

print ( chr(27)+"[2j" )

Norman.
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 plouf.

silly question but suppose this ESC]32; do some kind of color/type format because i see this characters here (XP) in console ?

Christos
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 pbdep.
Originally posted by plouf

silly question but suppose this ESC]32; do some kind of color/type format because i see this characters here (XP) in console ?

Christos

Not so silly...you need ansi.sys or nansi.sys enabled for DOS console.
I was working on a linux ANSI console...

Norman.
Post Reply