Page 1 of 1

PostPosted: Fri Oct 11, 2002 4:54 am
by design4use
Anybody whether it is impossible for some reason to set the insertion point in a UIField e.g. via
UIField.inspt = 20;
where 20 in this example is somewhere inside some text in the field. When I try to set inspt and then to insert some text at that position, it always stays at the same value, which is after the last char of the text of the field.
Anybody experienced this before?
[fyi - the text that was in the field before was set programatically if that makes any difference]

any and all help is much appreciated,

PostPosted: Fri Oct 11, 2002 6:41 am
by samps
It works fine. You must be on the wrong track in some way or another.

Quick testcase:

handler mainForm.onopen() {

handler button102.onselect() {

The field displays Original when the form opens. The first insertion fails because there is no such thing as the fifteenth characer in the field, so it puts 5 1's immidiately after 'Original', to display Original11111.

The next insertion works as intended, because now the field has programmatically gotten enough characters for inspt=9 to make sense, and the field now displays Original1222221111.

Are you sure that your insertion point is set to a value that is within the length of the field? Is the filed capped in length by Maax Characters?


PostPosted: Fri Oct 11, 2002 3:42 pm
by design4use
finally found the problem:
I was accidentally adding an integer to a string when computing the inspt, so instead of 5 + 4 (which is 9) I got "5" + 4 which ended up being "54". Never mind and thanks for the test case. Sleep is a good thing every once in awhile.