Re: text - going to specific line numbers.



tclcoder@xxxxxxxxxxxxxxxxxxxx wrote:

Quite right. After creation, you have a text box that, when managed
will occupy an area that is 7 lines long.

Thanks for clarifying this - and to Ron too, who also made some helpful suggestions.


$statsresults delete 4.0 4.end

will that achieve it, or do all the other line numbers change, the fact
one has been deleted?


That will work. 4.end is just before the newline, so nothing else
changes. Continuing my example above

$statusresults delete 4.0 4.end
$statusresults insert "Some new text for line 4"

Should do the trick.

Cheers


Perhaps instead I should write just a newline on the line I want to clear:

$statsresults insert 4.0 "\n"



If you do this, you will change the existing lines 4-7 to lines 5-8
which is almost certainly not what you want.

You are right - it was not what I wanted!


Note also that text widget line numbers start from one rather than
zero. Writing to line zero appears not to be an error, it just gets
silently converted to line one.

I was aware of that, although I know the code snippit i posted refereed to line 0.

Finally, it looks as though you will be using your seven lines to
format things in a fixed way. Have you considered a set of 7 label
widgets, rather than a single 7-line text widget? It might be less
confusing to code.

Its possible I might want to do a bit of formatting (underlining a word, putting a few characters in a proportional font etc), which I think would be easier in a text box.

Hope this helps,

Yes it did Alan, thank you.


--
Dave (from the UK)

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@xxxxxxxxxxxx
Hitting reply will work for a few months only - later set it manually.

http://chessdb.sourceforge.net/ - a Free open-source Chess Database
.



Relevant Pages

  • Prevent Blank Records being written. Need Help.
    ... Secondary record format is as follows: ... character text field, ... no input mask requirement ... allow zero length = yes. ...
    (microsoft.public.access.forms)
  • RE: Prevent Blank Records being written. Need Help.
    ... Secondary record format is as follows: ... > no input mask requirement ... > 30 character text field, ... > allow zero length = yes. ...
    (microsoft.public.access.forms)
  • Re: zero values in bar chart
    ... If column or bar, what did you want - how do you want to plot ... If zero always means zero, then you should definitely trust your ... Create a second column data series, with the values of N or 0 as ... above, then format the series with the pale fill, or no fill. ...
    (microsoft.public.excel.charting)
  • RE: Formatting a Spreadsheet
    ... There's a checkbox under Tools, Options, on the View tab, by which you ... can control IN GENERAL the display of zero values. ... in my experience it won't be long before you need some cells to ... Select the cellwhose display format you want to change. ...
    (microsoft.public.excel.misc)
  • Re: Number+1
    ... I had to add a (between CDbl and Format and drop one of the 0's from "Format ... Text String portion. ... using the BeforeInsert event means that the code will only run when a new ... post is 7110001 - no leading zero. ...
    (microsoft.public.access.gettingstarted)