[racket] display problem
Op 6-4-2012 15:23, Stephen Bloch schreef:
>
> On Apr 6, 2012, at 3:39 AM, Roelof Wobben wrote:
>
>> ;interp. (make-editorst)means the text in the editor is
>> ;(string-append
>> <http://docs.racket-lang.org/htdp-langs/beginner.html#%28def._%28lib._htdp-beginner..rkt._lang%29._%28%28lib._lang%2Fhtdp-beginner..rkt%29._string-append%29%29>st)with
>> the cursor displayed between sand t
>>
>>
>>
>> So for aaaaaaa| s has the value of aaaaa en t has the value of ""
>
> No, s should be "aaaaaaa" and t should be "".
>
>> For aaaa|aaaa s I think s has the value of aaaaa and t has the value
>> of aaa
>
> No, s should be "aaaa" and t should be "aaaa". The cursor is supposed
> to be displayed between s and t.
>
>> If I use the length of the first string and I press one time on the
>> left-key then the new-length could be the old-one - 1. Then I could
>> use substring to cut that part away.
>
> Sure. Note that you'll need to not only make the new s shorter than
> the old s, but also make the new t longer than the old t. And vice
> versa when somebody presses on the right-arrow key.
>
>> The t part I could say if it's empty substring ( s , (string-lenght
>> s), 1) and if it's not empty use a string-append.
>
> You could, but that's unnecessarily complicated. string-append works
> regardless of whether s or t is empty.
>
>
> Stephen Bloch
> sbloch at adelphi.edu <mailto:sbloch at adelphi.edu>
>
Thanks,
I now know I have a idea which could work.
Roelof
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120406/b2d9fa05/attachment.html>