Posted: Sun Jul 20, 2014 10:14 am Post subject: Set current positions in edit and memo
How could I set the current position inside edits and memos?
Like if I have text ("Pluto is millions miles away"), and I want to place the current position (where user input would go) after miles how could I do so? _________________
I'm rusty and getting older, help me re-learn lua.
Posted: Sun Jul 20, 2014 11:32 am Post subject: Re: Set current positions in edit and memo
DaSpamer wrote:
How could I set the current position inside edits and memos?
Like if I have text ("Pluto is millions miles away"), and I want to place the current position (where user input would go) after miles how could I do so?
Let's say that input holds the user input.
Trick #1:
Code:
UDF1.editbox.Caption = string.format('Pluto is millions miles %s away', input )
Trick #2,using captures:
Code:
UDF1.editbox.Caption = string.gsub( 'Pluto is millions miles away' , '(miles) (away)' , '%1 ' .. input .. ' %2' )
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum