Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29284 Discussions

Problem in SETTEXTWINDOW or OUTTEXT?

dboggs
New Contributor I
981 Views

I have a child text window in a Quickwin program. I'm trying to mimic a button using a text region say 1 row high by 10 columns wide, starting at row 5 column 11:

CALL SETTEXTWINDOW (5, 11, 5, 20)

Write a text label 9 characters long to this area:

CALL SETTEXTPOSITION (1, 1, T)

CALL OUTTEXT ('123456789')

That works OK, and the 10th column of the "button" is left blank. But if instead I try to usethe *entire* button (i.e. every column of the text window):

CALL OUTTEXT ('1234567890')

Nothing at all is printed, resulting in a blank button label. Apparently it is impossible to write a character string X characters long into a text region X characters wide?!

It also appears to be impossible to write a single character to the last position of a text region:

CALL SETTEXTPOSITION (1, 10, T)

CALL OUTTEXT ('X')

This also fails to print anything.

What gives?

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
981 Views
The problem is the (your) text window has a cursor, when you fill out the text line to the last column the cursor is displayed on the next line causing the line to wrap and index.

Unfortunately movetext and puttext have been removed from the CRTL.

Consider using WriteConsoleOutput.

Note, the data bufffer is in elements of CHAR_INFO {char, attribute}.
You can roll your own replacement for puttext using WriteConsoleOutput.

Jim Dempsey


0 Kudos
Steven_L_Intel1
Employee
981 Views
You can't do Windows API console writes to a QuickWin window.
0 Kudos
dboggs
New Contributor I
981 Views
Thanks for the responses. I'm glad to have the explanation--cursed cursor! But sad that this is apparently the intended behavior, with no apparent solution.

So, I'll just accept that the last column of my text windows will always be blank and unusable.
0 Kudos
jimdempseyatthecove
Honored Contributor III
981 Views
Try turning the cursor off

DISPLAYCURSOR ($GCURSOROFF)

Or SETTEXTCURSOR (Z'0101')

Jim Dempsey
0 Kudos
Reply