Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CVF question: String Table caption seems to be limited at 1020 chars.

Status
Not open for further replies.

TommyCee

Civil/Environmental
Nov 6, 2009
13
In using the String Table feature in Compaq Visual Fortran (CVF6x) - linking to an About dlg. box - I seem to have noted a total character limit of 1020 (in a note I added to a caption). This is so even when the calling program dimensions szBuffer & MaxInput to (say) 1200 or more.

Can anyone confirm what I seem to be seeing (I saw this limit mentioned nowhere in ANY documentation), and (better) please let me know if there's a way to expand this buffer? Or is the 1020-char. limit sacred and set in granite?

Also, the IDE help file seems to indicate that an expression like \r (for carriage return) in the caption text will force a new line. I have not seen this to work. Does anyone now how to force a new line in the String Table caption, or is it even really possible?

Thanks.
 
Replies continue below

Recommended for you

The 1020 limit looks like a line limit: it is not a string limit. Basically, if a character is about 10 pixels, this would be 10200 pixels long which will easily cover more than 8 screens of 1024x768 resolution. The Windows limit is 8 screens.

Anyway, if you use CRLF instead of CR, you'll get nice lines.
Code:
program main
   include 'flib.fd'
   integer iret
   character*1600 about
   
   ! Fill in the array
   do ii = 1, 1501, 100 
      do jj = 0, 97
         ix = ii + jj
         about(ix:ix) = 'X'
      end do
      ! Add CRLF at after 98 chars
      ix = ii + 98
      about(ix:ix) = char(13)
      ix = ix + 1
      about(ix:ix) = char(10)
   end do
   iret = AboutBoxQQ (about)
   print *, 'Click Help/About'
   stop
end
 
Thanks XWB but I'm not sure this will help.

What I have in the calling program (f.WinMain) is this:

integer(4) :: MaxInput
character(1200) :: szBuffer

MaxInput = 1200
ret = LoadString(GetModuleHandle(NULL), IDS_String1, szBuffer, MaxInput)
lret = DlgInit(IDD_AboutDlg, Dlg)

...

lret = DlgSet(Dlg, IDC_EditBackground, szBuffer)
ret = DlgModal(Dlg) !Launch the About screen


The string (in the Resource Editor) is filled with a lot of text, and this text is presented in an Edit Box (IDC_EditBackground) on the About Dialog with these settings: Multiline; Vertical Scroll. The amount of text is tied to the value of MaxInput & szBuffer; when these were initiated at 256, that's where the string ended. I expanded to 1000 and more text was accepted. Once I reached the "sacred" bound of 1020, that's where everything stopped.

Does this help?
 
Just been having a look at the C++ version. The limit on strings in .rc files is 256. I'll have to try more than 256 to see what happens.

The alternative is to concatenate several 256 byte strings to make up a big one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor