Inserting a character (LC 7.0.1)

Graham Samuel livfoss at mac.com
Sun Nov 2 17:47:39 EST 2014


Thanks again - it's all a bit too clever for its own good, IMHO. A nice convention like "the insertionPoint" would be easier. Still, nobody is going to change the language just for me...

I am now struggling with doing this insertion business in Unicode. Turns out you can't just paste a Unicode character into a LiveCode script on a PC if say you want to test against it, as in

if myChar = "$"

where instead of $ you want some Unicode character copied from a web page or something like that. You may even see the character on the screen, but when you close LiveCode and reopen the stack in new activation of LC, that glyph is replaced by "?". It seems you have to use numToCodePoint and its inverse. But I am still exploring...

Graham


> On 2 Nov 2014, at 22:09, J. Landman Gay <jacque at hyperactivesw.com> wrote:
> 
> On 11/2/2014, 2:25 PM, Graham Samuel wrote:
>> Thanks Jacque, as I didn't think anything had been selected, I never thought of 'the selection'. In fact the LC dictionary says
>> 
>>> >The selection is a reference to the currently selected text.
>> Which doesn't seem to accord with a flashing cursor in a text string and nothing highlighted, i.e. nothing selected - but there it is.
> 
> I thought it was under "selection" but it turns out the explanation is under "selectedChunk":
> 
> "If no text is selected but the text insertion point is in a field, the startChar is the character after the insertion point, and the endChar is the character before the insertion point. In this case, the endChar is one less than the startChar."
> 
> I think it should be in both places. "Selection" is easier to work with than parsing the selectedChunk and putting new text after word 2 of it.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list