LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
Fermin
- Posts: 149
- Joined: Fri Jun 05, 2015 10:44 pm
Post
by Fermin » Mon May 23, 2016 10:52 pm
Scripts in a field (with lockText, of course)
It works or not, according to the order of the lines.
Code: Select all
on mouseup
answer the clickline -- it works
set the textstyle of me to plain
end mouseup
------------------------
on mouseup
set the textstyle of me to plain
answer the clickline -- it does not work
end mouseup
-
bn
- VIP Livecode Opensource Backer

- Posts: 4172
- Joined: Sun Jan 07, 2007 9:12 pm
Post
by bn » Tue May 24, 2016 8:42 am
Hi Fermin,
the dictionary says:
The clickLine function is cleared at the next mouse click, as well as after some editing actions such as deleting text. If the last click was not in a field, the clickLine function returns empty.
setting the textStyle of a field is apparently one of the editing actions. You force a rebuild of the field.
Kind regards
Bernd
-
Fermin
- Posts: 149
- Joined: Fri Jun 05, 2015 10:44 pm
Post
by Fermin » Tue May 24, 2016 12:51 pm
You're right, I should have read carefully the dictionary. Thank you very much, Bernd.
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10324
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Tue May 24, 2016 2:49 pm
What Bernd said.
This is why one should ALWAYS put the results of these functions, as well as anything that loads the local variable "it", into another variable RIGHT AWAY.
And this is coming from someone who is sloppy in that regard, and has to go back now and then and fix stuff instead of doing it right the first time.
Craig Newman