View previous topic :: View next topic |
Author |
Message |
silicondale
Joined: 15 Mar 2007 Posts: 248 Location: Matlock, Derbyshire, UK
|
Posted: Thu Apr 14, 2016 2:51 pm Post subject: Word wrap |
|
|
It would be incredibly useful to have a word wrap feature, either as a basic option in a simple i=winio@ ('.....') call or as an option for %eb
As it is, I haven't found any alternative to writing text as fixed-length lines which don't necessarily fill the full width of a window - since that width is generated at run-time depending on the particular set of controls that are being used.
Example:
[/img]
It would be much neater if the block of text at the top could be output as a single string, automatically word-wrapped to the width of the window.
Maybe there's a way to do this (other than going to VS and using Visual Clearwin) but I haven't found it! |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Apr 14, 2016 4:48 pm Post subject: |
|
|
You could try %re without a horizontal scroll. |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 248 Location: Matlock, Derbyshire, UK
|
Posted: Thu Apr 14, 2016 5:39 pm Post subject: |
|
|
Thanks - that certainly goes some way to what is needed. Seems to do the word wrap OK. However the width and height of the %re box seem to be fixed. This means that when the text is very short, there is a lot of blank space in the box. Also, I have set the width to a reasonable maximum, but the required width can be different for different applications.
[/img]
However, there are a limited number of options for both width and depth, so this is livable with. I don't suppose there is any way to use integer variables in place of M and N in winio@('%N.Mre[options]', buffer) is there ?
Anyway, many thanks for the workaround! |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Apr 14, 2016 7:31 pm Post subject: |
|
|
In format codes, N and M can usually be replaced by * (i.e. %*.*re in this case) and the integer values are then provided in the argument list (before the associated character argument in this case).
In some contexts it is helpful to construct the format string for winio@ dynamically in the program by an internal WRITE to a character variable. |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 248 Location: Matlock, Derbyshire, UK
|
Posted: Fri Apr 15, 2016 11:37 am Post subject: |
|
|
Excellent - thanks for that, Paul. Internal write of the format string fixed it. Something I hadn't done before but now I see how it could help in a few other situations too!
I needed to set the font to FixedSys so I could calculate the correct number of lines (with Arial, the text looked better but took less space so there were a few blank lines!).
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Apr 15, 2016 1:10 pm Post subject: |
|
|
Blimey Paul. Where does it say that in the documentation?
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Apr 15, 2016 5:15 pm Post subject: |
|
|
It was in my head so I must have read/written it somewhere but when I came to look I could not find it either. I am wondering if a few links in the help file have got lost on the way. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sat Apr 16, 2016 12:25 pm Post subject: |
|
|
I know that there's a lot on what with the 64-bit version, keeping pace with visual studio, fixing bugs, coping with whatever Microsoft throws up in terms of changes to Windows, and all the rest of it, so I am completely understanding about priorities and all that. I also understand that printing documentation is an expensive overhead. I had a look at the costs of small runs of properly bound booklets and my goodness, aren't they expensive.
When I look at the online documentation (and by that I include web, the help file, the PDFs of old documents and the enhancements file) I know that if there is something that I know already exists, that I might have used but don't really remember the details, then if I'm prepared to put in the time and effort I can find it. Well mostly. I'm also someone who has taken the time to read the documentation in advance of having specific needs in my programs. But I'll never be able to find something that simply isn't there!
The help documentation isn't always very searchable, it is often not complete, and it definitely doesn't often list some of the deficiencies or limitations. As to the 5000 separate choices, I'm glad I'm not running that particular bit of software. But it might have been useful to point out in the documentation that the list was limited to 64K characters. Perhaps yet another file on this site or in the distribution listing known limitations and "issues" could be at least in part an answer.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sat Apr 16, 2016 4:26 pm Post subject: |
|
|
Thanks for the feedback Eddie. Your support is much appreciated. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Sat Apr 23, 2016 2:04 pm Post subject: |
|
|
The use of asterisks is described under Win32 platform->ClearWin+->Input and output->Data output. This section relates to %wd etc.. It should say that the same principle also applies to %rd etc..
The other place to look is Win32 platform->ClearWin+->Format windows->Advanced use of format windows. |
|
Back to top |
|
|
|