Re: [fpc-pascal] installing ppcrossarm from cvs
> > As many months ago the solution for me was and has been to override > cprtO.o with prtO.o > > If my program is working thanks to overwrite cprtO.o with prtO.o What > does it means? > prt0 is for static programs, cprt0 is for libc programs. cprt0 initialises and finalises libc, prt0 does not. So I think it simply means that your program links to libc, but doesn't use it, or doesn't use parts that rely on initialisation. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] terminal width/height
Hi all, Is there a function to query the terminal width and height, as a number of characters? For example, in windows 98, the terminal is always 80 characters wide, but the height varies; in linux, the height and width can both change, even while the program is running. I'm throwing some text up on the screen and would like to be able to format it to fit the terminal width and height. Thanks, David ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] terminal width/height
Quoting David Emerson <[EMAIL PROTECTED]>: > Is there a function to query the terminal width and height, as a number of > characters? If you "use CRT", you can make use of gotoxy() and WhereX plus WhereY to find out. Below is a unit I sometimes use for this purpose. Hope this helps, Unit UWinSize; { This unit determines the size of a text window. Just include it, and the variables will be set automatically. } Interface Uses CRT; Var ScreenMaxX, ScreenMaxY : Integer; Procedure SetScreenMax; Implementation Var Current, Increment : Integer; Function Biggest(UseX : Boolean) : Integer; Var Done : Boolean; Begin Repeat If UseX Then Begin GotoXY(Current,1); Done:= Current <> WhereX; End Else Begin GotoXY(1,Current); Done:= Current <> WhereY; End; If Not Done Then Current := Current + Increment; Until Done; Biggest := Current - Increment; End; Procedure SetScreenMax; Begin Current := 10; Increment := 10; Current := Biggest(True); Increment := 1; ScreenMaxX := Biggest(True); Current := 10; Increment := 10; Current := Biggest(False); Increment := 1; ScreenMaxY := Biggest(False); End; Var StartingX, StartingY : Integer; Begin StartingX := WhereX; StartingY := WhereY; SetScreenMax; GotoXY(StartingX,StartingY); End. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] terminal width/height
David Emerson wrote: Hi all, Is there a function to query the terminal width and height, as a number of characters? For example, in windows 98, the terminal is always 80 characters wide, but the height varies; in linux, the height and width can both change, even while the program is running. I'm throwing some text up on the screen and would like to be able to format it to fit the terminal width and height. Thanks, David If you use Video unit, check ScreenWidth/Height variables. If you use Crt, - under UNIX look also at ScreenWidth/Height variables. - Under Win32 (I say it only looking at Crt sources) you should be able to use initial values of WindMaxX and WindMaxY (they seem to be initialized at the initialization of Crt on Win32 to screen size). BTW to devels interested in Crt unit: - under UNIX WindMaxX, WindMaxY, WindMinX, WindMinY are broken. Unix Crt implementation uses private variables WinMaxX, WinMaxY, WinMinX, WinMinY (without "d" in the middle), I think that this should be changed to use public variables WindMaxX, WindMaxY, WindMinX, WindMinY. - under Win32, functions GetScreenWidth/Height could be made public under names ScreenWidth/Height (without "Get"), this would be compatible with Unix Crt. Michalis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal