video_config
Definition: |
sequence s = video_config()
|
|||||||||||||||||||||||||||||||||
Description: |
Returns a sequence of 10 non-negative integer values describing the current video configuration.
Somewhat a legacy routine from DOS32 days, which may however still be useful for some items (4
out of 10, ie {3,4,9,10}):
|
|||||||||||||||||||||||||||||||||
pwa/p2js: |
Not properly supported, but returns the constant {1,3,25,80,0,0,32,1,25,80}, ie assumes a 25x80 screen. Not however that position() and get_position() are (really) not supported under pwa/p2js. |
|||||||||||||||||||||||||||||||||
Comments: | Beyond saying that VC_LINES and VC_COLUMNS are the size of the buffer, usually larger
than VC_SCRNLINES and VC_SCRNCOLS, which are the size of the visible area, the choice
of which is required is application specific, however the last two items are probably
more likely to be useful.
In Phix, the VC_XXX constants are automatically defined, see psym.e/syminit(). On Linux, simply returns the constant {1,3,25,80,0,0,32,1,25,80}, ie assumes a 25x80 screen. Should anyone know of any way to obtain the current terminal size (in characters), let me know. |
|||||||||||||||||||||||||||||||||
Example: |
vc = video_config() -- vc is eg {1, 3, 300, 80, 0, 0, 32, 1, 25, 80} if length(vc)>=VC_SCRNCOLS then lines = vc[VC_SCRNLINES] cols = vc[VC_SCRNCOLS] else -- (RDS Eu compatibility) lines = vc[VC_LINES] cols = vc[VC_COLUMNS] end if |
|||||||||||||||||||||||||||||||||
Compatibility: |
RDS Eu requires include graphics.e and returns a sequence of 8 elements only.
Euphoria requires include std\graphcst.e
Should you require a routine that is compatible across Phix, RDS Eu, and Euphoria, then I suggest that you adapt/rename the one in builtins\pscreen.e, and perhaps rely on/copy the VC_XXX constants in builtins\graphics.e, rather than struggle with those other include files/builtins, especially with regards to RDS Eu. |
|||||||||||||||||||||||||||||||||
Implementation: | See builtins\pscreen.e (an autoinclude) for details of the actual implementation. |