- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a console window
SETTEXTPOSITION doesnt work
So how is it possible to set (and retrieve) the cursor position?
Thankx
Jim
(Our old code does it by using assembler routines to pass ansi.sys command strings - True)
SETTEXTPOSITION doesnt work
So how is it possible to set (and retrieve) the cursor position?
Thankx
Jim
(Our old code does it by using assembler routines to pass ansi.sys command strings - True)
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are Win32 APIs for manipulating a console window and setting the position. See Console Functions In particular, SetConsoleCursorPosition. You'll need to call GetStdHandle first to get a handle to the console.
ANSI.SYS doesn't work in 32-bit Windows.
ANSI.SYS doesn't work in 32-bit Windows.
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jim.cox
In a console window
SETTEXTPOSITION doesnt work
So how is it possible to set (and retrieve) the cursor position?
Thankx
Jim
(Our old code does it by using assembler routines to pass ansi.sys command strings - True)
SETTEXTPOSITION doesnt work
So how is it possible to set (and retrieve) the cursor position?
Thankx
Jim
(Our old code does it by using assembler routines to pass ansi.sys command strings - True)
Jim,
this won't work in a simple console window. Have alook at the Graphics Library Routines under the QuickWin section of the documentation to find out more about using these features. You will need to create a TextWindow instead of a console window.
Regards,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - David White
Jim,
this won't work in a simple console window. Have alook at the Graphics Library Routines under the QuickWin section of the documentation to find out more about using these features. You will need to create a TextWindow instead of a console window.
Regards,
David
Thought that might be the case :(
So how do I include the Quickwin stuff properly into my program?
If in the code I
USE IFQWIN
and later
CALL SETTEXTWINDOW(1,1,24,80)
At linking I get an unresolved external for _SETTEXTWINDOW
Change the Fortran runtime libraries from debug multithreaded to debug quickwin generates a _winMain already defined error as well as _SETTEXTWINDOW and _DIR being unresolved
And adding IFQWIN.LIB to the linker's dependency list creates a whole stack of unresolved externals
(The new progam started life as an SDI code windowing application if that makes any difference)
Cheers
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are Win32 APIs for manipulating a console window and setting the position. See Console Functions In particular, SetConsoleCursorPosition. You'll need to call GetStdHandle first to get a handle to the console.
ANSI.SYS doesn't work in 32-bit Windows.
ANSI.SYS doesn't work in 32-bit Windows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
There are Win32 APIs for manipulating a console window and setting the position. See Console Functions In particular, SetConsoleCursorPosition. You'll need to call GetStdHandle first to get a handle to the console.
ANSI.SYS doesn't work in 32-bit Windows.
ANSI.SYS doesn't work in 32-bit Windows.
GetStdHandle or GetConsoleWindow? or are they the same given an AllocConsole() ?
> ANSI.SYS doesn't work in 32-bit Windows.
Well, it works fine in an XP command window - but its really really clunky - which is one reason I'm having to rewrite both the frontend and libraries for this particular baby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
GetConsoleWindow will work. ANSI.SYS works only for 16-bit apps. We got this complaint a LOT with CVF from people moving from DOS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Having trouble with the second paramter to the SetConsoleCursorPosition call.
According to the documentation the call looks like
BOOL WINAPI SetConsoleCursorPosition(
HANDLE hConsoleOutput,
COORD dwCursorPosition
);
where a COORD is
typedef struct _COORD { SHORT X; SHORT Y;
} COORD, *PCOORD;
I'm trying a structure that looks like
TYPE COORD
INTEGER(2) X
INTEGER(2) Y
END TYPE
TYPE (COORD) C
but I keep getting
error #6633: The type of the actual argument differs from the type of the dummy argument.
Any thoughts?
According to the documentation the call looks like
BOOL WINAPI SetConsoleCursorPosition(
HANDLE hConsoleOutput,
COORD dwCursorPosition
);
where a COORD is
typedef struct _COORD { SHORT X; SHORT Y;
} COORD, *PCOORD;
I'm trying a structure that looks like
TYPE COORD
INTEGER(2) X
INTEGER(2) Y
END TYPE
TYPE (COORD) C
but I keep getting
error #6633: The type of the actual argument differs from the type of the dummy argument.
Any thoughts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's a routine I did in CVF that sets the cursor position. Proabably pretty close to what
you'd need in IVF.
subroutine gotoxy(irow,icol)you'd need in IVF.
use dflib
use dfwin
integer fhandle
logical lstat
Type(T_COORD) wpos
fhandle = GetStdHandle(STD_OUTPUT_HANDLE)
wpos.x = icol
wpos.y = irow
lstat = SetConsoleCursorPosition(fhandle, wpos)
return
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to use type T_COORD, not a type that "looks like" it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
You need to use type T_COORD, not a type that "looks like" it.
Thankx, that did the trick :)
Is there a good source for documentation of the ifort view of the winapi interface and the libraries?
Cheers
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The sources for the modules are in the compiler's INCLUDE folder.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page