Discussion:
Setting hidden of lines very slow
Kaveh Bazargan via use-livecode
2018-11-30 10:33:04 UTC
Permalink
I have a text field with some 3500 lines of text. I want to ensure all
lines are visible, as I have hidden some before. I use:

repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat

This is taking over 1 minute to complete. I have tried removing all styling
from the text so e.g. backgroundcolor is empty, etc. Same result.

Any suggestions pls?

--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Niggemann, Bernd via use-livecode
2018-11-30 11:14:20 UTC
Permalink
Try

set the hidden of line 1 to - 1 of field 1 to false


Kind regards

Bernd


From: Kaveh Bazargan

I have a text field with some 3500 lines of text. I want to ensure all
lines are visible, as I have hidden some before. I use:

repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat

This is taking over 1 minute to complete. I have tried removing all styling
from the text so e.g. backgroundcolor is empty, etc. Same result.

Any suggestions pls?

--
Kaveh Bazargan
Andre Alves Garzia via use-livecode
2018-11-30 11:48:56 UTC
Permalink
tied locking the screen first?

On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
> I have a text field with some 3500 lines of text. I want to ensure all
> lines are visible, as I have hidden some before. I use:
>
> repeat with i = 1 the number of lines of fld 1
> set the hidden of line i of fld 1 to false
> end repeat
>
> This is taking over 1 minute to complete. I have tried removing all styling
> from the text so e.g. backgroundcolor is empty, etc. Same result.
>
> Any suggestions pls?
>
Klaus major-k via use-livecode
2018-11-30 11:56:02 UTC
Permalink
Hi Andre,

> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode <use-***@lists.runrev.com>:
>
> tied locking the screen first?

tied AND locked?
Andre, you are hardcore! :-D

> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
>> I have a text field with some 3500 lines of text. I want to ensure all
>> lines are visible, as I have hidden some before. I use:
>>
>> repeat with i = 1 the number of lines of fld 1
>> set the hidden of line i of fld 1 to false
>> end repeat
>>
>> This is taking over 1 minute to complete. I have tried removing all styling
>> from the text so e.g. backgroundcolor is empty, etc. Same result.
>>
>> Any suggestions pls?

Best

Klaus

--
Klaus Major
http://www.major-k.de
***@major-k.de
Andre Alves Garzia via use-livecode
2018-11-30 12:04:51 UTC
Permalink
Klaus,

uhahuahuahuaahuauhahuhuahuahua it took me a while to notice.

On 30/11/2018 11:56, Klaus major-k via use-livecode wrote:
> Hi Andre,
>
>> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode <use-***@lists.runrev.com>:
>>
>> tied locking the screen first?
> tied AND locked?
> Andre, you are hardcore! :-D
>
>> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
>>> I have a text field with some 3500 lines of text. I want to ensure all
>>> lines are visible, as I have hidden some before. I use:
>>>
>>> repeat with i = 1 the number of lines of fld 1
>>> set the hidden of line i of fld 1 to false
>>> end repeat
>>>
>>> This is taking over 1 minute to complete. I have tried removing all styling
>>> from the text so e.g. backgroundcolor is empty, etc. Same result.
>>>
>>> Any suggestions pls?
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> ***@major-k.de
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Kaveh Bazargan via use-livecode
2018-11-30 12:07:24 UTC
Permalink
Thank you guys. I am always embarrassed to ask here as I know the answer is
a one liner!!

And Andre the screen was locked already. :-)

On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
use-***@lists.runrev.com> wrote:

> Hi Andre,
>
> > Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode <
> use-***@lists.runrev.com>:
> >
> > tied locking the screen first?
>
> tied AND locked?
> Andre, you are hardcore! :-D
>
> > On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
> >> I have a text field with some 3500 lines of text. I want to ensure all
> >> lines are visible, as I have hidden some before. I use:
> >>
> >> repeat with i = 1 the number of lines of fld 1
> >> set the hidden of line i of fld 1 to false
> >> end repeat
> >>
> >> This is taking over 1 minute to complete. I have tried removing all
> styling
> >> from the text so e.g. backgroundcolor is empty, etc. Same result.
> >>
> >> Any suggestions pls?
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> ***@major-k.de
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Andre Alves Garzia via use-livecode
2018-11-30 12:11:42 UTC
Permalink
There is another tip here in this thread about

set the hidden of line 1 to -1 of field "the field" to false

As a single command, it might be better.

On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
> Thank you guys. I am always embarrassed to ask here as I know the answer is
> a one liner!!
>
> And Andre the screen was locked already. :-)
>
> On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
> use-***@lists.runrev.com> wrote:
>
>> Hi Andre,
>>
>>> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode <
>> use-***@lists.runrev.com>:
>>> tied locking the screen first?
>> tied AND locked?
>> Andre, you are hardcore! :-D
>>
>>> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
>>>> I have a text field with some 3500 lines of text. I want to ensure all
>>>> lines are visible, as I have hidden some before. I use:
>>>>
>>>> repeat with i = 1 the number of lines of fld 1
>>>> set the hidden of line i of fld 1 to false
>>>> end repeat
>>>>
>>>> This is taking over 1 minute to complete. I have tried removing all
>> styling
>>>> from the text so e.g. backgroundcolor is empty, etc. Same result.
>>>>
>>>> Any suggestions pls?
>> Best
>>
>> Klaus
>>
>> --
>> Klaus Major
>> http://www.major-k.de
>> ***@major-k.de
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
Kaveh Bazargan via use-livecode
2018-11-30 13:07:25 UTC
Permalink
Yes Andre, that is the line that fixed it, in a split second :-)

But here is a follow-up: Now I want to hide all lines that have no text
style and only show lines with colored text. I use:

repeat with i = 1 to the number of lines of fld 1
if the textcolor of line i of fld "text" is not empty then
set the hidden of line i of fld "text" to false
end if
end repeat

This is taking time too. Any suggestions how to speed this up?

On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode <
use-***@lists.runrev.com> wrote:

> There is another tip here in this thread about
>
> set the hidden of line 1 to -1 of field "the field" to false
>
> As a single command, it might be better.
>
> On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
> > Thank you guys. I am always embarrassed to ask here as I know the answer
> is
> > a one liner!!
> >
> > And Andre the screen was locked already. :-)
> >
> > On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
> > use-***@lists.runrev.com> wrote:
> >
> >> Hi Andre,
> >>
> >>> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via use-livecode <
> >> use-***@lists.runrev.com>:
> >>> tied locking the screen first?
> >> tied AND locked?
> >> Andre, you are hardcore! :-D
> >>
> >>> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
> >>>> I have a text field with some 3500 lines of text. I want to ensure all
> >>>> lines are visible, as I have hidden some before. I use:
> >>>>
> >>>> repeat with i = 1 the number of lines of fld 1
> >>>> set the hidden of line i of fld 1 to false
> >>>> end repeat
> >>>>
> >>>> This is taking over 1 minute to complete. I have tried removing all
> >> styling
> >>>> from the text so e.g. backgroundcolor is empty, etc. Same result.
> >>>>
> >>>> Any suggestions pls?
> >> Best
> >>
> >> Klaus
> >>
> >> --
> >> Klaus Major
> >> http://www.major-k.de
> >> ***@major-k.de
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-***@lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Andre Alves Garzia via use-livecode
2018-11-30 13:41:29 UTC
Permalink
Kaveh,

I would work which lines should be shown and hidden inside a variable
and then replace the whole field...

On 30/11/2018 13:07, Kaveh Bazargan wrote:
> Yes Andre, that is the line that fixed it, in a split second :-)
>
> But here is a follow-up: Now I want to hide all lines that have no
> text style and only show lines with colored text. I use:
>
> repeat with i = 1 to the number of lines of fld 1
>       if the textcolor of line i of fld "text" is not empty then
>          set the hidden of line i of fld "text" to false
>       end if
>    end repeat
>
> This is taking time too. Any suggestions how to speed this up?
>
> On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode
> <use-***@lists.runrev.com <mailto:use-***@lists.runrev.com>>
> wrote:
>
> There is another tip here in this thread about
>
> set the hidden of line 1 to -1 of field "the field" to false
>
> As a single command, it might be better.
>
> On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
> > Thank you guys. I am always embarrassed to ask here as I know
> the answer is
> > a one liner!!
> >
> > And Andre the screen was locked already. :-)
> >
> > On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
> > use-***@lists.runrev.com
> <mailto:use-***@lists.runrev.com>> wrote:
> >
> >> Hi Andre,
> >>
> >>> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via
> use-livecode <
> >> use-***@lists.runrev.com
> <mailto:use-***@lists.runrev.com>>:
> >>> tied locking the screen first?
> >> tied AND locked?
> >> Andre, you are hardcore! :-D
> >>
> >>> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
> >>>> I have a text field with some 3500 lines of text. I want to
> ensure all
> >>>> lines are visible, as I have hidden some before. I use:
> >>>>
> >>>> repeat with i = 1 the number of lines of fld 1
> >>>>        set the hidden of line i of fld 1 to false
> >>>> end repeat
> >>>>
> >>>> This is taking over 1 minute to complete. I have tried
> removing all
> >> styling
> >>>> from the text so e.g. backgroundcolor is empty, etc. Same result.
> >>>>
> >>>> Any suggestions pls?
> >> Best
> >>
> >> Klaus
> >>
> >> --
> >> Klaus Major
> >> http://www.major-k.de
> >> ***@major-k.de <mailto:***@major-k.de>
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-***@lists.runrev.com
> <mailto:use-***@lists.runrev.com>
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com <mailto:use-***@lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> --
> Kaveh Bazargan
> Director
> River Valley Technologies <http://rivervalleytechnologies.com/> •
> Twitter <https://twitter.com/kaveh1000> • LinkedIn
> <https://www.linkedin.com/in/bazargankaveh/>
Ingar Roggen via use-livecode
2018-11-30 17:02:37 UTC
Permalink
Hello, André,
I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
Regards
Ingar

Sendt fra min iPhone

> 30. nov. 2018 kl. 14:41 skrev Andre Alves Garzia via use-livecode <use-***@lists.runrev.com>:
>
> Kaveh,
>
> I would work which lines should be shown and hidden inside a variable and then replace the whole field...
>
>> On 30/11/2018 13:07, Kaveh Bazargan wrote:
>> Yes Andre, that is the line that fixed it, in a split second :-)
>>
>> But here is a follow-up: Now I want to hide all lines that have no text style and only show lines with colored text. I use:
>>
>> repeat with i = 1 to the number of lines of fld 1
>> if the textcolor of line i of fld "text" is not empty then
>> set the hidden of line i of fld "text" to false
>> end if
>> end repeat
>>
>> This is taking time too. Any suggestions how to speed this up?
>>
>> On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode <use-***@lists.runrev.com <mailto:use-***@lists.runrev.com>> wrote:
>>
>> There is another tip here in this thread about
>>
>> set the hidden of line 1 to -1 of field "the field" to false
>>
>> As a single command, it might be better.
>>
>> On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
>> > Thank you guys. I am always embarrassed to ask here as I know
>> the answer is
>> > a one liner!!
>> >
>> > And Andre the screen was locked already. :-)
>> >
>> > On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
>> > use-***@lists.runrev.com
>> <mailto:use-***@lists.runrev.com>> wrote:
>> >
>> >> Hi Andre,
>> >>
>> >>> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via
>> use-livecode <
>> >> use-***@lists.runrev.com
>> <mailto:use-***@lists.runrev.com>>:
>> >>> tied locking the screen first?
>> >> tied AND locked?
>> >> Andre, you are hardcore! :-D
>> >>
>> >>> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
>> >>>> I have a text field with some 3500 lines of text. I want to
>> ensure all
>> >>>> lines are visible, as I have hidden some before. I use:
>> >>>>
>> >>>> repeat with i = 1 the number of lines of fld 1
>> >>>> set the hidden of line i of fld 1 to false
>> >>>> end repeat
>> >>>>
>> >>>> This is taking over 1 minute to complete. I have tried
>> removing all
>> >> styling
>> >>>> from the text so e.g. backgroundcolor is empty, etc. Same result.
>> >>>>
>> >>>> Any suggestions pls?
>> >> Best
>> >>
>> >> Klaus
>> >>
>> >> --
>> >> Klaus Major
>> >> http://www.major-k.de
>> >> ***@major-k.de <mailto:***@major-k.de>
>> >>
>> >>
>> >> _______________________________________________
>> >> use-livecode mailing list
>> >> use-***@lists.runrev.com
>> <mailto:use-***@lists.runrev.com>
>> >> Please visit this url to subscribe, unsubscribe and manage your
>> >> subscription preferences:
>> >> http://lists.runrev.com/mailman/listinfo/use-livecode
>> >>
>> >
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com <mailto:use-***@lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>>
>> --
>> Kaveh Bazargan
>> Director
>> River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter <https://twitter.com/kaveh1000> • LinkedIn <https://www.linkedin.com/in/bazargankaveh/>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Bob Sneidar via use-livecode
2018-11-30 17:49:20 UTC
Permalink
I'll jump in here.

Porting/opening Hypercard stacks is a convenience. The primary issue is that Hypercard was optimized to index every text of every card in a stack to make finding information easier. New records? New cards.

Livecode? Not so much. In fact, not at all. There will be performance issues. But at least your field and button layouts will be intact, and you scripting *should* work out of the box.

At that point, your next task will be to refactor your app to switch to a database oriented app with single form layouts as opposed to multiple cards as records. Getting the information out of your cards and into a database, although not difficult, will have to be scripted. So far as I know, there is nothing that can "automagically" do that for you.

Bob S


> On Nov 30, 2018, at 09:02 , Ingar Roggen via use-livecode <use-***@lists.runrev.com> wrote:
>
> Hello, André,
> I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
> Regards
> Ingar
Ingar Roggen via use-livecode
2018-11-30 21:41:51 UTC
Permalink
Thank you, Bob

> 30. nov. 2018 kl. 18.49 skrev Bob Sneidar via use-livecode <use-***@lists.runrev.com>:
>
> I'll jump in here.
>
> Porting/opening Hypercard stacks is a convenience. The primary issue is that Hypercard was optimized to index every text of every card in a stack to make finding information easier. New records? New cards.
>
> Livecode? Not so much. In fact, not at all. There will be performance issues. But at least your field and button layouts will be intact, and you scripting *should* work out of the box.
>
> At that point, your next task will be to refactor your app to switch to a database oriented app with single form layouts as opposed to multiple cards as records. Getting the information out of your cards and into a database, although not difficult, will have to be scripted. So far as I know, there is nothing that can "automagically" do that for you.
>
> Bob S
>
>
>> On Nov 30, 2018, at 09:02 , Ingar Roggen via use-livecode <use-***@lists.runrev.com> wrote:
>>
>> Hello, André,
>> I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
>> Regards
>> Ingar
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Devin Asay via use-livecode
2018-11-30 19:10:04 UTC
Permalink
The authoritative guide for converting HyperCard stacks to LiveCode is still Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html

Devin

On Nov 30, 2018, at 10:02 AM, Ingar Roggen via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>> wrote:

Hello, André,
I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
Regards
Ingar

Sendt fra min iPhone

30. nov. 2018 kl. 14:41 skrev Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>>:

Kaveh,

I would work which lines should be shown and hidden inside a variable and then replace the whole field...

On 30/11/2018 13:07, Kaveh Bazargan wrote:
Yes Andre, that is the line that fixed it, in a split second :-)

But here is a follow-up: Now I want to hide all lines that have no text style and only show lines with colored text. I use:

repeat with i = 1 to the number of lines of fld 1
if the textcolor of line i of fld "text" is not empty then
set the hidden of line i of fld "text" to false
end if
end repeat

This is taking time too. Any suggestions how to speed this up?

On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>> wrote:

There is another tip here in this thread about

set the hidden of line 1 to -1 of field "the field" to false

As a single command, it might be better.

On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
Thank you guys. I am always embarrassed to ask here as I know
the answer is
a one liner!!

And Andre the screen was locked already. :-)

On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
<mailto:use-***@lists.runrev.com>> wrote:

Hi Andre,

Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via
use-livecode <
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
<mailto:use-***@lists.runrev.com>>:
tied locking the screen first?
tied AND locked?
Andre, you are hardcore! :-D

On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
I have a text field with some 3500 lines of text. I want to
ensure all
lines are visible, as I have hidden some before. I use:

repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat

This is taking over 1 minute to complete. I have tried
removing all
styling
from the text so e.g. backgroundcolor is empty, etc. Same result.

Any suggestions pls?
Best

Klaus

--
Klaus Major
http://www.major-k.de
***@major-k.de <mailto:***@major-k.de>


_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com
<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter <https://twitter.com/kaveh1000> • LinkedIn <https://www.linkedin.com/in/bazargankaveh/>
_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Director
Office of Digital Humanities
Brigham Young University
kee nethery via use-livecode
2018-11-30 19:13:16 UTC
Permalink
And I thought I was the last hold-out using Hypercard. Sold all my PPC Mac Minis.

Kee nethery
Ingar Roggen via use-livecode
2018-11-30 21:49:04 UTC
Permalink
I’ll use HC on the other side too, Kee!
Ingar

> 30. nov. 2018 kl. 20.13 skrev kee nethery via use-livecode <use-***@lists.runrev.com>:
>
> And I thought I was the last hold-out using Hypercard. Sold all my PPC Mac Minis.
>
> Kee nethery
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Ingar Roggen via use-livecode
2018-11-30 21:50:00 UTC
Permalink
I’ll look into it again, Devin.

> 30. nov. 2018 kl. 20.10 skrev Devin Asay via use-livecode <use-***@lists.runrev.com>:
>
> The authoritative guide for converting HyperCard stacks to LiveCode is still Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html
>
> Devin
>
> On Nov 30, 2018, at 10:02 AM, Ingar Roggen via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>> wrote:
>
> Hello, André,
> I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
> Regards
> Ingar
>
> Sendt fra min iPhone
>
> 30. nov. 2018 kl. 14:41 skrev Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>>:
>
> Kaveh,
>
> I would work which lines should be shown and hidden inside a variable and then replace the whole field...
>
> On 30/11/2018 13:07, Kaveh Bazargan wrote:
> Yes Andre, that is the line that fixed it, in a split second :-)
>
> But here is a follow-up: Now I want to hide all lines that have no text style and only show lines with colored text. I use:
>
> repeat with i = 1 to the number of lines of fld 1
> if the textcolor of line i of fld "text" is not empty then
> set the hidden of line i of fld "text" to false
> end if
> end repeat
>
> This is taking time too. Any suggestions how to speed this up?
>
> On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>> wrote:
>
> There is another tip here in this thread about
>
> set the hidden of line 1 to -1 of field "the field" to false
>
> As a single command, it might be better.
>
> On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
> Thank you guys. I am always embarrassed to ask here as I know
> the answer is
> a one liner!!
>
> And Andre the screen was locked already. :-)
>
> On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
> <mailto:use-***@lists.runrev.com>> wrote:
>
> Hi Andre,
>
> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via
> use-livecode <
> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
> <mailto:use-***@lists.runrev.com>>:
> tied locking the screen first?
> tied AND locked?
> Andre, you are hardcore! :-D
>
> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
> I have a text field with some 3500 lines of text. I want to
> ensure all
> lines are visible, as I have hidden some before. I use:
>
> repeat with i = 1 the number of lines of fld 1
> set the hidden of line i of fld 1 to false
> end repeat
>
> This is taking over 1 minute to complete. I have tried
> removing all
> styling
> from the text so e.g. backgroundcolor is empty, etc. Same result.
>
> Any suggestions pls?
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> ***@major-k.de <mailto:***@major-k.de>
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> <mailto:use-***@lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> --
> Kaveh Bazargan
> Director
> River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter <https://twitter.com/kaveh1000> • LinkedIn <https://www.linkedin.com/in/bazargankaveh/>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> Devin Asay
> Director
> Office of Digital Humanities
> Brigham Young University
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Ingar Roggen via use-livecode
2018-11-30 22:02:45 UTC
Permalink
But before that I would like to know if MacPaint works in LC. Anybody know that?

Sendt fra min iPhone

> 30. nov. 2018 kl. 22:50 skrev Ingar Roggen via use-livecode <use-***@lists.runrev.com>:
>
> I’ll look into it again, Devin.
>
>> 30. nov. 2018 kl. 20.10 skrev Devin Asay via use-livecode <use-***@lists.runrev.com>:
>>
>> The authoritative guide for converting HyperCard stacks to LiveCode is still Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html
>>
>> Devin
>>
>> On Nov 30, 2018, at 10:02 AM, Ingar Roggen via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>> wrote:
>>
>> Hello, André,
>> I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
>> Regards
>> Ingar
>>
>> Sendt fra min iPhone
>>
>> 30. nov. 2018 kl. 14:41 skrev Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>>:
>>
>> Kaveh,
>>
>> I would work which lines should be shown and hidden inside a variable and then replace the whole field...
>>
>> On 30/11/2018 13:07, Kaveh Bazargan wrote:
>> Yes Andre, that is the line that fixed it, in a split second :-)
>>
>> But here is a follow-up: Now I want to hide all lines that have no text style and only show lines with colored text. I use:
>>
>> repeat with i = 1 to the number of lines of fld 1
>> if the textcolor of line i of fld "text" is not empty then
>> set the hidden of line i of fld "text" to false
>> end if
>> end repeat
>>
>> This is taking time too. Any suggestions how to speed this up?
>>
>> On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>> wrote:
>>
>> There is another tip here in this thread about
>>
>> set the hidden of line 1 to -1 of field "the field" to false
>>
>> As a single command, it might be better.
>>
>> On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
>> Thank you guys. I am always embarrassed to ask here as I know
>> the answer is
>> a one liner!!
>>
>> And Andre the screen was locked already. :-)
>>
>> On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
>> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
>> <mailto:use-***@lists.runrev.com>> wrote:
>>
>> Hi Andre,
>>
>> Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via
>> use-livecode <
>> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
>> <mailto:use-***@lists.runrev.com>>:
>> tied locking the screen first?
>> tied AND locked?
>> Andre, you are hardcore! :-D
>>
>> On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
>> I have a text field with some 3500 lines of text. I want to
>> ensure all
>> lines are visible, as I have hidden some before. I use:
>>
>> repeat with i = 1 the number of lines of fld 1
>> set the hidden of line i of fld 1 to false
>> end repeat
>>
>> This is taking over 1 minute to complete. I have tried
>> removing all
>> styling
>> from the text so e.g. backgroundcolor is empty, etc. Same result.
>>
>> Any suggestions pls?
>> Best
>>
>> Klaus
>>
>> --
>> Klaus Major
>> http://www.major-k.de
>> ***@major-k.de <mailto:***@major-k.de>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com
>> <mailto:use-***@lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>>
>> --
>> Kaveh Bazargan
>> Director
>> River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter <https://twitter.com/kaveh1000> • LinkedIn <https://www.linkedin.com/in/bazargankaveh/>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> Devin Asay
>> Director
>> Office of Digital Humanities
>> Brigham Young University
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Richard Gaskin via use-livecode
2018-11-30 22:37:44 UTC
Permalink
Ingar Roggen wrote:

> But before that I would like to know if MacPaint works in LC.
> Anybody know that?

I doubt it. IIRC the format was directly dependent on QuickDraw - from
Wikipedia:

Applications using QuickDraw will still run under OS X 10.8
through macOS 10.12; however, the current versions of Xcode
and the macOS SDK do not contain the header files to compile
such programs.

https://en.wikipedia.org/wiki/Apple_QuickDraw


This is one of the benefits I've come to appreciate with open source:
data longevity. When formats and the code needed to operate on them are
free and open, data can never die.

Proprietary formats only live as long as the vendor chooses to support them.

I have a hard drive in my archives filled with data dependent on
software that no longer runs on any modern OS.

--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
***@FourthWorld.com http://www.FourthWorld.com
kee nethery via use-livecode
2018-12-01 05:35:37 UTC
Permalink
Livecode is a program for creating programs.
MacPaint is a program for creating images that as far as I know ran on 68K macs. Not sure it ever ran on PPC Macs. Not sure if MacPaint images can import into Livecode.
Asking if MacPaint works in LC doesn’t make sense to me.
Kee

> On Nov 30, 2018, at 2:02 PM, Ingar Roggen via use-livecode <use-***@lists.runrev.com> wrote:
>
> But before that I would like to know if MacPaint works in LC. Anybody know that?
>
> Sendt fra min iPhone
Ingar Roggen via use-livecode
2018-12-01 09:42:11 UTC
Permalink
I recognize the importance of asking adequate questions. I don’t know if the one about MacPaint (MP) belongs to that group. But I use MP all the time with SheepShaver and believe that the partial scriptability of MP perhaps was HC’s greatest contribution to interactive use of words and images in thinking. It’s a question of coordinating logic and imagination. Ingar

Sendt fra min iPhone

> 1. des. 2018 kl. 06:36 skrev kee nethery via use-livecode <use-***@lists.runrev.com>:
>
> Livecode is a program for creating programs.
> MacPaint is a program for creating images that as far as I know ran on 68K macs. Not sure it ever ran on PPC Macs. Not sure if MacPaint images can import into Livecode.
> Asking if MacPaint works in LC doesn’t make sense to me.
> Kee
>
>> On Nov 30, 2018, at 2:02 PM, Ingar Roggen via use-livecode <use-***@lists.runrev.com> wrote:
>>
>> But before that I would like to know if MacPaint works in LC. Anybody know that?
>>
>> Sendt fra min iPhone
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Kee Nethery via use-livecode
2018-12-01 14:47:23 UTC
Permalink
Great clarification. Thank you. Your question now makes perfect sense to me, and I don’t have the answer for you. Hopefully someone else does.

Kee Nethery

> On Dec 1, 2018, at 1:42 AM, Ingar Roggen <***@sosiologi.uio.no> wrote:
>
> I recognize the importance of asking adequate questions. I don’t know if the one about MacPaint (MP) belongs to that group. But I use MP all the time with SheepShaver and believe that the partial scriptability of MP perhaps was HC’s greatest contribution to interactive use of words and images in thinking. It’s a question of coordinating logic and imagination. Ingar
>
> Sendt fra min iPhone
>
>> 1. des. 2018 kl. 06:36 skrev kee nethery via use-livecode <use-***@lists.runrev.com>:
>>
>> Livecode is a program for creating programs.
>> MacPaint is a program for creating images that as far as I know ran on 68K macs. Not sure it ever ran on PPC Macs. Not sure if MacPaint images can import into Livecode.
>> Asking if MacPaint works in LC doesn’t make sense to me.
>> Kee
>>
>>> On Nov 30, 2018, at 2:02 PM, Ingar Roggen via use-livecode <use-***@lists.runrev.com> wrote:
>>>
>>> But before that I would like to know if MacPaint works in LC. Anybody know that?
>>>
>>> Sendt fra min iPhone
>>
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
Ingar Roggen via use-livecode
2018-12-01 17:00:37 UTC
Permalink
Thank you, Kee

> 1. des. 2018 kl. 15.47 skrev Kee Nethery via use-livecode <use-***@lists.runrev.com>:
>
> Great clarification. Thank you. Your question now makes perfect sense to me, and I don’t have the answer for you. Hopefully someone else does.
>
> Kee Nethery
>
>> On Dec 1, 2018, at 1:42 AM, Ingar Roggen <***@sosiologi.uio.no> wrote:
>>
>> I recognize the importance of asking adequate questions. I don’t know if the one about MacPaint (MP) belongs to that group. But I use MP all the time with SheepShaver and believe that the partial scriptability of MP perhaps was HC’s greatest contribution to interactive use of words and images in thinking. It’s a question of coordinating logic and imagination. Ingar
>>
>> Sendt fra min iPhone
>>
>>> 1. des. 2018 kl. 06:36 skrev kee nethery via use-livecode <use-***@lists.runrev.com>:
>>>
>>> Livecode is a program for creating programs.
>>> MacPaint is a program for creating images that as far as I know ran on 68K macs. Not sure it ever ran on PPC Macs. Not sure if MacPaint images can import into Livecode.
>>> Asking if MacPaint works in LC doesn’t make sense to me.
>>> Kee
>>>
>>>> On Nov 30, 2018, at 2:02 PM, Ingar Roggen via use-livecode <use-***@lists.runrev.com> wrote:
>>>>
>>>> But before that I would like to know if MacPaint works in LC. Anybody know that?
>>>>
>>>> Sendt fra min iPhone
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-***@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Richard Gaskin via use-livecode
2018-12-02 00:37:37 UTC
Permalink
Ingar Roggen wrote:

> I recognize the importance of asking adequate questions. I don’t know
> if the one about MacPaint (MP) belongs to that group. But I use MP all
> the time with SheepShaver and believe that the partial scriptability
> of MP perhaps was HC’s greatest contribution to interactive use of
> words and images in thinking. It’s a question of coordinating logic
> and imagination. Ingar

MacPaint's feature set was pretty limited, by design. It shipped with
Macs as a way to show off bitmap graphics, but simple enough that it
wouldn't compete with third-party offerings.

Is there anything in MacPaint that can't be done with LC's bitmap objects?

--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
***@FourthWorld.com http://www.FourthWorld.com
Ingar Roggen via use-livecode
2018-12-02 22:25:21 UTC
Permalink
http://lowendmac.com/2014/apples-revolutionary-hypercard/
<<<<<<<<<<<<<<<<<<<<<<<<<<<•>>>>>>>>>>>>>>>>>>>>>>>>>>>
In 2002, the International HyperCard Users Group estimated there were 10,000 active HyperCard users worldwide.
<<<<<<<<<<<<<<<<<<<<<<<<<<<•>>>>>>>>>>>>>>>>>>>>>>>>>>>

Hello, Devin!
As confirmed above the International HyperCard Users Group estimated there were 10,000 active HyperCard users worldwide in 2002. Is LC anywhere near that number? Maybe. And if maybe not, why not? A truly successful LC should have been able to attract the 10,000 HC users worldwide and additionally the group of dedicated LC users. Maybe 10,000 of those too? Then we are 20,000? And if not, why not? What magic was lost along the road? HC was the winner. Where is it now? My one is in my Mac, always at hand. 10,000-1=9,999. Im still here, asking for an easier access to LC. If the authoritative guide for converting HyperCard stacks to LiveCode still is Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html, why not elaborate it to the tool, the app needed to make HC accessible "to the rest of us" again? Anybody takes the challenge?
Ingar
30. nov. 2018 kl. 23.02 skrev Ingar Roggen <***@sosiologi.uio.no<mailto:***@sosiologi.uio.no>>:

But before that I would like to know if MacPaint works in LC. Anybody know that?

Sendt fra min iPhone

30. nov. 2018 kl. 22:50 skrev Ingar Roggen via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>>:

I’ll look into it again, Devin.

30. nov. 2018 kl. 20.10 skrev Devin Asay via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>>:

The authoritative guide for converting HyperCard stacks to LiveCode is still Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html

Devin

On Nov 30, 2018, at 10:02 AM, Ingar Roggen via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com><mailto:use-***@lists.runrev.com>> wrote:

Hello, André,
I hope you still remember that we met in Las Vegas. I still use HyperCard and wonder if it has become easier to port HC-stacks to LiveCode? Do you know if there are any apps for that? And if not, would it be difficult to write them?
Regards
Ingar

Sendt fra min iPhone

30. nov. 2018 kl. 14:41 skrev Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com><mailto:use-***@lists.runrev.com>>:

Kaveh,

I would work which lines should be shown and hidden inside a variable and then replace the whole field...

On 30/11/2018 13:07, Kaveh Bazargan wrote:
Yes Andre, that is the line that fixed it, in a split second :-)

But here is a follow-up: Now I want to hide all lines that have no text style and only show lines with colored text. I use:

repeat with i = 1 to the number of lines of fld 1
if the textcolor of line i of fld "text" is not empty then
set the hidden of line i of fld "text" to false
end if
end repeat

This is taking time too. Any suggestions how to speed this up?

On Fri, 30 Nov 2018 at 12:12, Andre Alves Garzia via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com><mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>> wrote:

There is another tip here in this thread about

set the hidden of line 1 to -1 of field "the field" to false

As a single command, it might be better.

On 30/11/2018 12:07, Kaveh Bazargan via use-livecode wrote:
Thank you guys. I am always embarrassed to ask here as I know
the answer is
a one liner!!

And Andre the screen was locked already. :-)

On Fri, 30 Nov 2018 at 11:56, Klaus major-k via use-livecode <
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com><mailto:use-***@lists.runrev.com>
<mailto:use-***@lists.runrev.com>> wrote:

Hi Andre,

Am 30.11.2018 um 12:48 schrieb Andre Alves Garzia via
use-livecode <
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com><mailto:use-***@lists.runrev.com>
<mailto:use-***@lists.runrev.com>>:
tied locking the screen first?
tied AND locked?
Andre, you are hardcore! :-D

On 30/11/2018 10:33, Kaveh Bazargan via use-livecode wrote:
I have a text field with some 3500 lines of text. I want to
ensure all
lines are visible, as I have hidden some before. I use:

repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat

This is taking over 1 minute to complete. I have tried
removing all
styling
from the text so e.g. backgroundcolor is empty, etc. Same result.

Any suggestions pls?
Best

Klaus

--
Klaus Major
http://www.major-k.de
***@major-k.de <mailto:***@major-k.de>


_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com
<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com> <mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter <https://twitter.com/kaveh1000> • LinkedIn <https://www.linkedin.com/in/bazargankaveh/>
_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Director
Office of Digital Humanities
Brigham Young University

_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Trevor DeVore via use-livecode
2018-11-30 14:54:22 UTC
Permalink
On Fri, Nov 30, 2018 at 7:08 AM Kaveh Bazargan via use-livecode <
use-***@lists.runrev.com> wrote:

> But here is a follow-up: Now I want to hide all lines that have no text
> style and only show lines with colored text. I use:
>
> repeat with i = 1 to the number of lines of fld 1
> if the textcolor of line i of fld "text" is not empty then
> set the hidden of line i of fld "text" to false
> end if
> end repeat
>
> This is taking time too. Any suggestions how to speed this up?
>

Try working with the styledText property.

```
put the styledText of field "text" into tTextA

# loop through paragraphs
repeat with i = 1 to the number of elements of tTextA
# Check if first run has textcolor set
if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
# hide paragraph
put true into tTextA[i]["style"]["hidden"]
end if
end repeat

set the styledText of fld "text" to tTextA
```

--
Trevor DeVore
CTO - ScreenSteps
www.screensteps.com
hh via use-livecode
2018-11-30 15:32:11 UTC
Permalink
If showing *only* lines with colored text means that all others
are hidden then you could use:

...
set hidden of line i of fld "text" to \
(the textcolor of line i of fld "text" is empty)
...

Trevor's script would then read:
...
put (tTextA[i]["runs"][1]["style"]["textcolor"] is empty) \
into tTextA[i]["style"]["hidden"]
...

Here yet another fast method:

on mouseUp
put the millisecs into m1
lock screen; lock messages
put the htmltext of fld 1 into ht
set linedelimiter to "<p"
put the htmltext of fld 1 into ht
replace " hidden" with empty in ht
repeat for each line L in ht
if offset("color=",L)>0 then put "<p" & L after s
else put "<p hidden" & L after s
end repeat
set htmltext of fld 1 to s
put the millisecs-m1 into fld "timing"
end mouseUp


> > Kaveh wrote:
> > But here is a follow-up: Now I want to hide all lines that
> > have no text style and only show lines with colored text.
> > I use:
> >
> > repeat with i = 1 to the number of lines of fld 1
> > if the textcolor of line i of fld "text" is not empty then
> > set the hidden of line i of fld "text" to false
> > end if
> > end repeat
> >
> > This is taking time too. Any suggestions how to speed this up?
> >
>
> Trevor wrote:
> Try working with the styledText property.
>
> put the styledText of field "text" into tTextA
>
> # loop through paragraphs
> repeat with i = 1 to the number of elements of tTextA
> # Check if first run has textcolor set
> if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
> # hide paragraph
> put true into tTextA[i]["style"]["hidden"]
> end if
> end repeat
>
> set the styledText of fld "text" to tTextA
Kaveh Bazargan via use-livecode
2018-11-30 16:15:15 UTC
Permalink
Did not know about textStyle which has opened a whole new world! Thank you
so much for ruining my weekend Trevor. ;-)

hh, I love the first solution, which shows the beauty of LiveCode. But the
speed is the same as before...

i will try htmltext too. A while since I worked with it.

Thanks again.

On Fri, 30 Nov 2018 at 15:33, hh via use-livecode <
use-***@lists.runrev.com> wrote:

> If showing *only* lines with colored text means that all others
> are hidden then you could use:
>
> ...
> set hidden of line i of fld "text" to \
> (the textcolor of line i of fld "text" is empty)
> ...
>
> Trevor's script would then read:
> ...
> put (tTextA[i]["runs"][1]["style"]["textcolor"] is empty) \
> into tTextA[i]["style"]["hidden"]
> ...
>
> Here yet another fast method:
>
> on mouseUp
> put the millisecs into m1
> lock screen; lock messages
> put the htmltext of fld 1 into ht
> set linedelimiter to "<p"
> put the htmltext of fld 1 into ht
> replace " hidden" with empty in ht
> repeat for each line L in ht
> if offset("color=",L)>0 then put "<p" & L after s
> else put "<p hidden" & L after s
> end repeat
> set htmltext of fld 1 to s
> put the millisecs-m1 into fld "timing"
> end mouseUp
>
>
> > > Kaveh wrote:
> > > But here is a follow-up: Now I want to hide all lines that
> > > have no text style and only show lines with colored text.
> > > I use:
> > >
> > > repeat with i = 1 to the number of lines of fld 1
> > > if the textcolor of line i of fld "text" is not empty then
> > > set the hidden of line i of fld "text" to false
> > > end if
> > > end repeat
> > >
> > > This is taking time too. Any suggestions how to speed this up?
> > >
> >
> > Trevor wrote:
> > Try working with the styledText property.
> >
> > put the styledText of field "text" into tTextA
> >
> > # loop through paragraphs
> > repeat with i = 1 to the number of elements of tTextA
> > # Check if first run has textcolor set
> > if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
> > # hide paragraph
> > put true into tTextA[i]["style"]["hidden"]
> > end if
> > end repeat
> >
> > set the styledText of fld "text" to tTextA
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Glen Bojsza via use-livecode
2018-11-30 16:30:51 UTC
Permalink
I was wondering at what stage or how the lines get chosen to be hidden or
not?
Kaveh Bazargan via use-livecode
2018-11-30 16:35:58 UTC
Permalink
I am simulating a non-contiguous selection of text with a "Find all" button
that sets the style of all found items of text.

Then I want to inspect those "selections" only but showing the paras that
contain them and hiding all other lines. So I have a full view and a
"compact" view that the user can choose by clicking a button

On Fri, 30 Nov 2018 at 16:31, Glen Bojsza via use-livecode <
use-***@lists.runrev.com> wrote:

> I was wondering at what stage or how the lines get chosen to be hidden or
> not?
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Dan Friedman via use-livecode
2018-11-30 17:12:43 UTC
Permalink
Kaveh,

Well, you learn something every day! I didn't know you could hide a line of text. Pretty cool!

FWIW, the fastest way that I know to remove all text stylings from a field of text is this:

put fld 1 into fld 1


-Dan


On 11/30/18, 8:37 AM, "use-livecode on behalf of Kaveh Bazargan via use-livecode" <use-livecode-***@lists.runrev.com on behalf of use-***@lists.runrev.com> wrote:

I am simulating a non-contiguous selection of text with a "Find all" button
that sets the style of all found items of text.

Then I want to inspect those "selections" only but showing the paras that
contain them and hiding all other lines. So I have a full view and a
"compact" view that the user can choose by clicking a button

On Fri, 30 Nov 2018 at 16:31, Glen Bojsza via use-livecode <
use-***@lists.runrev.com> wrote:

> I was wondering at what stage or how the lines get chosen to be hidden or
> not?
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Kaveh Bazargan via use-livecode
2018-11-30 17:17:13 UTC
Permalink
On Fri, 30 Nov 2018 at 17:12, Dan Friedman <***@clearvisiontech.com> wrote:

> Kaveh,
>
> Well, you learn something every day! I didn't know you could hide a line
> of text. Pretty cool!
>
>
Really nice. Working on speeding it up which will be great.


> FWIW, the fastest way that I know to remove all text stylings from a field
> of text is this:
>
> put fld 1 into fld 1
>
>
That's poetically beautiful. Now how many lines of JavaScript would that
be? ;-)


>
> -Dan
>
>
> On 11/30/18, 8:37 AM, "use-livecode on behalf of Kaveh Bazargan via
> use-livecode" <use-livecode-***@lists.runrev.com on behalf of
> use-***@lists.runrev.com> wrote:
>
> I am simulating a non-contiguous selection of text with a "Find all"
> button
> that sets the style of all found items of text.
>
> Then I want to inspect those "selections" only but showing the paras
> that
> contain them and hiding all other lines. So I have a full view and a
> "compact" view that the user can choose by clicking a button
>
> On Fri, 30 Nov 2018 at 16:31, Glen Bojsza via use-livecode <
> use-***@lists.runrev.com> wrote:
>
> > I was wondering at what stage or how the lines get chosen to be
> hidden or
> > not?
> > _______________________________________________
> > use-livecode mailing list
> > use-***@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> --
> Kaveh Bazargan
> Director
> River Valley Technologies <http://rivervalleytechnologies.com/> •
> Twitter
> <https://twitter.com/kaveh1000> • LinkedIn
> <https://www.linkedin.com/in/bazargankaveh/>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>

--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Bob Sneidar via use-livecode
2018-11-30 17:43:21 UTC
Permalink
And how much would the Javascript training and certification cost be to learn how to do it? ;-)

Bob S


> On Nov 30, 2018, at 09:17 , Kaveh Bazargan via use-livecode <use-***@lists.runrev.com> wrote:
>
>> FWIW, the fastest way that I know to remove all text stylings from a field
>> of text is this:
>>
>> put fld 1 into fld 1
>>
>>
> That's poetically beautiful. Now how many lines of JavaScript would that
> be? ;-)
Keith Clarke via use-livecode
2018-11-30 17:55:26 UTC
Permalink
In jQuery it’d be something like $j(‘div #id’).text(); selecting the field’s enclosing div by ID or class.

Best,
Keith

> On 30 Nov 2018, at 17:43, Bob Sneidar via use-livecode <use-***@lists.runrev.com> wrote:
>
> And how much would the Javascript training and certification cost be to learn how to do it? ;-)
>
> Bob S
>
>
>> On Nov 30, 2018, at 09:17 , Kaveh Bazargan via use-livecode <use-***@lists.runrev.com> wrote:
>>
>>> FWIW, the fastest way that I know to remove all text stylings from a field
>>> of text is this:
>>>
>>> put fld 1 into fld 1
>>>
>>>
>> That's poetically beautiful. Now how many lines of JavaScript would that
>> be? ;-)
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Richard Gaskin via use-livecode
2018-11-30 20:17:23 UTC
Permalink
Kaveh wrote:
> Now how many lines of JavaScript would that be? ;-)

The equivalent of chunk expressions are ridiculously verbose in JS, but
this one's not bad:

getElementById("id").removeAttribute("style");

--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
***@FourthWorld.com http://www.FourthWorld.com
Kaveh Bazargan via use-livecode
2018-12-01 10:21:56 UTC
Permalink
Hi all

I have learned a lot here, especially the hint of using styledText. But
there might be a misunderstanding. In my case, it is not necessarily the
whole line that is styled, but a line might *contain* a chunk of text that
is styled, e.g. one word in the middle of the line has textcolor set. So I
am looking to hide any line that contains no textcolor anywhere.

Trevors code contains:
...
if tTextA[i]["runs"][1]["style"]["textcolor"] is not empty then
...

If I understand correctly the ['runs'][1] is looking at the first element
of that line. I need to check that no other elements in the line are styled
either. Before I write a loop that is slow again, any quick way of checking
for a line with no style anywhere?

Thanks all for the great contributions.

K


On Fri, 30 Nov 2018 at 20:17, Richard Gaskin via use-livecode <
use-***@lists.runrev.com> wrote:

> Kaveh wrote:
> > Now how many lines of JavaScript would that be? ;-)
>
> The equivalent of chunk expressions are ridiculously verbose in JS, but
> this one's not bad:
>
> getElementById("id").removeAttribute("style");
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> ***@FourthWorld.com http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
Geoff Canyon via use-livecode
2018-11-30 19:27:55 UTC
Permalink
Why do you need to simulate non-contiguous selections? Set the
listBehavior, multipleHilites, and noncontiguousHilites of the field to
true and then you can do things like:

set the hilitedLines of fld 1 to 1,3,5

But to your original question, you should use:

repeat for each line L in the htmlText of fld 1
-- put some htmlText after a variable based on what L contains
end repeat
-- set the htmlText of fld 1 to the new htmlText

Or if you know what you want to do and don't need to check the existing
textColor and hidden, just:

repeat for each line L in fld 1


Here's an example of what the htmlText looks like for a field where the
first line has a font color and the second line is hidden:

<p><font color="#00FF00">test</font></p>
<p hidden>this</p>
<p>thing</p>

So if you don't need to check the existing state your code would look
something like this:

put 0 into i -- if you need a line count
repeat for each line L in fld 1
add 1 to i -- again, if you need a line count
if <test that says you're coloring this line> then
put "<p><font color=" & quote & "#00FF00" & quote & ">" & L & "</font></p>"
& cr after newHTML
else
put "<p hidden>" & L & "</p>" & cr after newHTML
end if
end repeat
set the htmlText of fld 1 to newHTML

gc


On Fri, Nov 30, 2018 at 8:36 AM Kaveh Bazargan via use-livecode <
use-***@lists.runrev.com> wrote:

> I am simulating a non-contiguous selection of text with a "Find all" button
> that sets the style of all found items of text.
>
> Then I want to inspect those "selections" only but showing the paras that
> contain them and hiding all other lines. So I have a full view and a
> "compact" view that the user can choose by clicking a button
>
> On Fri, 30 Nov 2018 at 16:31, Glen Bojsza via use-livecode <
> use-***@lists.runrev.com> wrote:
>
> > I was wondering at what stage or how the lines get chosen to be hidden or
> > not?
> > _______________________________________________
> > use-livecode mailing list
> > use-***@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> --
> Kaveh Bazargan
> Director
> River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
> <https://twitter.com/kaveh1000> • LinkedIn
> <https://www.linkedin.com/in/bazargankaveh/>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
hh via use-livecode
2018-12-01 13:45:56 UTC
Permalink
> Kaveh wrote:
> I am looking to hide any line that contains no textcolor anywhere.

I already gave you one that hides *exactly* these lines
(as you already wished in your first post).

> Hermann wrote:
> Here yet another fast method.
>
> on mouseUp
> put the millisecs into m1
> lock screen; lock messages
> put the htmltext of fld 1 into ht
> set linedelimiter to "<p"
> put the htmltext of fld 1 into ht
> replace " hidden" with empty in ht
> repeat for each line L in ht
> if offset("color=",L)>0 then put "<p" & L after s
> else put "<p hidden" & L after s
> end repeat
> set htmltext of fld 1 to s
> put the millisecs-m1 into fld "timing"
> end mouseUp
Kaveh Bazargan via use-livecode
2018-12-01 14:05:51 UTC
Permalink
Apologies hh. I can confirm that the htmltext method works beautifully and
blindingly fast. I was going to try it to understand fully first. I now do
and am grateful for the amazing tricks I have learned here. :-)

On Sat, 1 Dec 2018 at 13:46, hh via use-livecode <
use-***@lists.runrev.com> wrote:

>
> > Kaveh wrote:
> > I am looking to hide any line that contains no textcolor anywhere.
>
> I already gave you one that hides *exactly* these lines
> (as you already wished in your first post).
>
> > Hermann wrote:
> > Here yet another fast method.
> >
> > on mouseUp
> > put the millisecs into m1
> > lock screen; lock messages
> > put the htmltext of fld 1 into ht
> > set linedelimiter to "<p"
> > put the htmltext of fld 1 into ht
> > replace " hidden" with empty in ht
> > repeat for each line L in ht
> > if offset("color=",L)>0 then put "<p" & L after s
> > else put "<p hidden" & L after s
> > end repeat
> > set htmltext of fld 1 to s
> > put the millisecs-m1 into fld "timing"
> > end mouseUp
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
Kaveh Bazargan
Director
River Valley Technologies <http://rivervalleytechnologies.com/> • Twitter
<https://twitter.com/kaveh1000> • LinkedIn
<https://www.linkedin.com/in/bazargankaveh/>
hh via use-livecode
2018-12-01 14:40:11 UTC
Permalink
> Kaveh wrote:
> I can confirm that the htmltext method works beautifully and blindingly fast.

So we have here two methods:
The htmlText-method and the styledText-method.

There is an interesting result in the speed comparison of the two methods.

Here the htmlText-method is significantly faster with less than at about
1500 short lines, between 1500 and 2500 short lines speed is at about the
same, for more than at about 2500 short lines the styledText-method becomes
significantly faster.

As LC flattens any nested arrays the styledText-method is probably adjustable
and worth the loop through the runs: styledText experts please come in.

## HtmlText-method for any colored text chunk in the line.
on mouseUp
put the millisecs into m1
lock screen; lock messages
set linedelimiter to "<p"
put the htmltext of fld 1 into ht
replace " hidden" with empty in ht
repeat for each line L in ht
if offset("color=",L)>0 then put "<p" & L after s
else put "<p hidden" & L after s
end repeat
set htmltext of fld 1 to s
put the millisecs-m1 into fld "timing"
end mouseUp

## StyledText-method for a whole colorized line.
put the styledText of field "text" into tTextA
# loop through paragraphs
repeat with i = 1 to the number of elements of tTextA
# Check if first run has textcolor set
put (tTextA[i]["runs"][1]["style"]["textcolor"] is empty) \
into tTextA[i]["style"]["hidden"]
end if
end repeat
set the styledText of fld "text" to tTextA```
Tom Glod via use-livecode
2018-12-01 18:23:24 UTC
Permalink
Can someone explain the seemingly extraordinary performance improvement in
using apparently its "split second" vs "over a minute"

set the hidden of line 1 to - 1 of field 1 to false

vs.

repeat with i = 1 the number of lines of fld 1
set the hidden of line i of fld 1 to false
end repeat

it doesn't seem like the loop would be the bottleneck here, but rather the
work on the field itself....but obviously, I know nothing about this engine
:D

Thanks,



On Sat, Dec 1, 2018 at 9:40 AM hh via use-livecode <
use-***@lists.runrev.com> wrote:

> > Kaveh wrote:
> > I can confirm that the htmltext method works beautifully and blindingly
> fast.
>
> So we have here two methods:
> The htmlText-method and the styledText-method.
>
> There is an interesting result in the speed comparison of the two methods.
>
> Here the htmlText-method is significantly faster with less than at about
> 1500 short lines, between 1500 and 2500 short lines speed is at about the
> same, for more than at about 2500 short lines the styledText-method becomes
> significantly faster.
>
> As LC flattens any nested arrays the styledText-method is probably
> adjustable
> and worth the loop through the runs: styledText experts please come in.
>
> ## HtmlText-method for any colored text chunk in the line.
> on mouseUp
> put the millisecs into m1
> lock screen; lock messages
> set linedelimiter to "<p"
> put the htmltext of fld 1 into ht
> replace " hidden" with empty in ht
> repeat for each line L in ht
> if offset("color=",L)>0 then put "<p" & L after s
> else put "<p hidden" & L after s
> end repeat
> set htmltext of fld 1 to s
> put the millisecs-m1 into fld "timing"
> end mouseUp
>
> ## StyledText-method for a whole colorized line.
> put the styledText of field "text" into tTextA
> # loop through paragraphs
> repeat with i = 1 to the number of elements of tTextA
> # Check if first run has textcolor set
> put (tTextA[i]["runs"][1]["style"]["textcolor"] is empty) \
> into tTextA[i]["style"]["hidden"]
> end if
> end repeat
> set the styledText of fld "text" to tTextA```
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
Richard Gaskin via use-livecode
2018-12-02 00:45:59 UTC
Permalink
Tom Glod wrote:

> Can someone explain the seemingly extraordinary performance
> improvement in using apparently its "split second" vs "over a minute"
>
> set the hidden of line 1 to - 1 of field 1 to false
>
> vs.
>
> repeat with i = 1 the number of lines of fld 1
> set the hidden of line i of fld 1 to false
> end repeat
>
> it doesn't seem like the loop would be the bottleneck here, but rather
> the work on the field itself....but obviously, I know nothing about
> this engine

Think about all the steps a computer needs to take to render text in a
field.

Multiply that by the number of lines...

--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
***@FourthWorld.com http://www.FourthWorld.com
Tom Glod via use-livecode
2018-12-02 02:16:49 UTC
Permalink
So the first form populates the field only once....since its a single
command so no other states of the field will exist.

Makes perfect sense.

Thanks

On Sat, Dec 1, 2018 at 7:45 PM Richard Gaskin via use-livecode <
use-***@lists.runrev.com> wrote:

> Tom Glod wrote:
>
> > Can someone explain the seemingly extraordinary performance
> > improvement in using apparently its "split second" vs "over a minute"
> >
> > set the hidden of line 1 to - 1 of field 1 to false
> >
> > vs.
> >
> > repeat with i = 1 the number of lines of fld 1
> > set the hidden of line i of fld 1 to false
> > end repeat
> >
> > it doesn't seem like the loop would be the bottleneck here, but rather
> > the work on the field itself....but obviously, I know nothing about
> > this engine
>
> Think about all the steps a computer needs to take to render text in a
> field.
>
> Multiply that by the number of lines...
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> ***@FourthWorld.com http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
J. Landman Gay via use-livecode
2018-12-02 03:26:36 UTC
Permalink
Right, and accessing a field is one of the most expensive operations in LC.

Maybe Richard will post his analogy to the maintenance worker again. I
found it both amusing and informative.

--
Jacqueline Landman Gay | ***@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On December 1, 2018 8:18:52 PM Tom Glod via use-livecode
<use-***@lists.runrev.com> wrote:

> So the first form populates the field only once....since its a single
> command so no other states of the field will exist.
>
> Makes perfect sense.
>
> Thanks
>
> On Sat, Dec 1, 2018 at 7:45 PM Richard Gaskin via use-livecode <
> use-***@lists.runrev.com> wrote:
>
>> Tom Glod wrote:
>>
>> > Can someone explain the seemingly extraordinary performance
>> > improvement in using apparently its "split second" vs "over a minute"
>> >
>> > set the hidden of line 1 to - 1 of field 1 to false
>> >
>> > vs.
>> >
>> > repeat with i = 1 the number of lines of fld 1
>> > set the hidden of line i of fld 1 to false
>> > end repeat
>> >
>> > it doesn't seem like the loop would be the bottleneck here, but rather
>> > the work on the field itself....but obviously, I know nothing about
>> > this engine
>>
>> Think about all the steps a computer needs to take to render text in a
>> field.
>>
>> Multiply that by the number of lines...
>>
>> --
>> Richard Gaskin
>> Fourth World Systems
>> Software Design and Development for the Desktop, Mobile, and the Web
>> ____________________________________________________________________
>> ***@FourthWorld.com http://www.FourthWorld.com
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Richard Gaskin via use-livecode
2018-12-02 07:32:32 UTC
Permalink
J. Landman Gay wrote:

> Right, and accessing a field is one of the most expensive operations
> in LC.
>
> Maybe Richard will post his analogy to the maintenance worker again. I
> found it both amusing and informative.

http://lists.runrev.com/pipermail/use-livecode/2005-May/057144.html

:)

--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
***@FourthWorld.com http://www.FourthWorld.com
Håkan Liljegren via use-livecode
2018-12-03 14:51:00 UTC
Permalink
The code will not work if you have htmltext containing the text "color=" like:
<p>To set the color you can use color="#fa3b42"</p>

and you can also shave off some milliseconds in the styledText version by using foreach:


repeat for each key aKey in tTextA
      # Check if first run has textcolor set
      put (tTextA[aKey]["runs"][1]["style"]["textcolor"] is empty) \
            into tTextA[aKey]["style"]["hidden"]
 end repeat


For me that is always faster than your clever 'offset("color="…' version.

It is a bit strange though that the foreach always seams to be faster. If we try to sum an array with 100 000 element like:

   put 100000 into tNum
   # Create array with random numbers
   repeat with i = 1 to tNum
      put random(100) into tData[i]
   end repeat

   # Sum array by looping with index
   put the long seconds into tStart
   repeat with i = 1 to tNum
      add tData[i] to tSum
   end repeat
   put the long seconds - tStart into tTime1

   #Sum array by using foreach
   put the long seconds into tStart
   repeat for each key aKey in tData
      add tData[aKey] to tSum2
   end repeat
   put the long seconds - tStart into tTime2
   put tTime1 , tTime2, " ratio : " & tTime1 / tTime2

You will see that the second code is almost three times faster than the first one.

<Lesson>If it isn’t important that you process an indexed array in order foreach is always faster!</lesson>

Happy coding!

:-Håkan
On 1 Dec 2018, 15:40 +0100, How to use LiveCode , wrote:
>
> if offset("color=",L)>0 then put "<p" & L after s
> else put "<p hidden" & L after s
Alex Tweedly via use-livecode
2018-12-03 20:27:52 UTC
Permalink
On 03/12/2018 14:51, Håkan Liljegren via use-livecode
<use-***@lists.runrev.com> wrote:

> and you can also shave off some milliseconds in the styledText version by using foreach:
>
> …
>
>
> It is a bit strange though that the foreach always seams to be faster. If we try to sum an array with 100 000 element like:
>
>

I know you were demonstrating the difference between "repeat for each
key" and "repeat with i=", and using 'sum' to do so (very effectively).

But for completeness, just in case someone wanted to sum an array, I
would point out that  you could also do

> put the long seconds into tStart
> put sum(tData) into tSum3
> put the long seconds - tStart into tTime3
and that would another 4x faster again :-)
Alex
hh via use-livecode
2018-12-02 01:51:15 UTC
Permalink
> Richard G. wrote:
> ... Is there anything in MacPaint that can't be done with LC's bitmap objects?

"That can't be done" wins always, because the only limit for LC is the sky
(more exactly, sadly, the sky below the 65535-limit for all coordinates).

But there's a lot of features that are not done with LC's bitmap objects.
Even in a comparison with the paint features of HC some are missing (which
of course can be done, because the limit ...).
J. Landman Gay via use-livecode
2018-12-02 03:38:38 UTC
Permalink
As far as I know, LC includes all the scripted paint commands that HC had,
and adds native color besides. The stacks I've imported that used painting
commands worked with few changes, mostly only needing to slow them down due
to LC's faster engine and more modern CPUs.

The OP wants to emulate MacPaint, so image size limitations probably won't
be an issue.

--
Jacqueline Landman Gay | ***@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On December 1, 2018 7:53:03 PM hh via use-livecode
<use-***@lists.runrev.com> wrote:

>> Richard G. wrote:
>> ... Is there anything in MacPaint that can't be done with LC's bitmap objects?
>
> "That can't be done" wins always, because the only limit for LC is the sky
> (more exactly, sadly, the sky below the 65535-limit for all coordinates).
>
> But there's a lot of features that are not done with LC's bitmap objects.
> Even in a comparison with the paint features of HC some are missing (which
> of course can be done, because the limit ...).
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Ingar Roggen via use-livecode
2018-12-02 22:27:56 UTC
Permalink
> 2. des. 2018 kl. 04.38 skrev J. Landman Gay via use-livecode <use-***@lists.runrev.com>:
>
> As far as I know, LC includes all the scripted paint commands that HC had, and adds native color besides. The stacks I've imported that used painting commands worked with few changes, mostly only needing to slow them down due to LC's faster engine and more modern CPUs.
>
> The OP wants to emulate MacPaint, so image size limitations probably won't be an issue.
>
> --
> Jacqueline Landman Gay | ***@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On December 1, 2018 7:53:03 PM hh via use-livecode <use-***@lists.runrev.com> wrote:
>
>>> Richard G. wrote:
>>> ... Is there anything in MacPaint that can't be done with LC's bitmap objects?
>>
>> "That can't be done" wins always, because the only limit for LC is the sky
>> (more exactly, sadly, the sky below the 65535-limit for all coordinates).
>>
>> But there's a lot of features that are not done with LC's bitmap objects.
>> Even in a comparison with the paint features of HC some are missing (which
>> of course can be done, because the limit ...).
>> _______________________________________________
>> use-livecode mailing list
>> use-***@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Ingar Roggen via use-livecode
2018-12-02 23:10:17 UTC
Permalink
http://lowendmac.com/2014/apples-revolutionary-hypercard/

<<<<<<<<<<<<<<<<<<<<<<<<<<<•>>>>>>>>>>>>>>>>>>>>>>>>>>>

In 2002, the International HyperCard Users Group estimated there were 10,000 active HyperCard users worldwide.

<<<<<<<<<<<<<<<<<<<<<<<<<<<•>>>>>>>>>>>>>>>>>>>>>>>>>>>



Hello, Devin!

As confirmed above the International HyperCard Users Group estimated there were 10,000 active HyperCard users worldwide in 2002. Is LC anywhere near that number? Maybe. And if maybe not, why not? A truly successful LC should have been able to attract the 10,000 HC users worldwide and additionally the group of dedicated LC users. Maybe 10,000 of those too? Then we are 20,000? And if not, why not? What magic was lost along the road? HC was the winner. Where is it now? My one is in my Mac, always at hand. 10,000-1=9,999. Im still here, asking for an easier access to LC. If the authoritative guide for converting HyperCard stacks to LiveCode still is Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html, why not elaborate it to the tool, the app needed to make HC easily portable to LC and thereby accessible "to the rest of us" again? Anybody takes the challenge?

Ingar


30. nov. 2018 kl. 20.10 wrote Devin Asay via use-livecode:


The authoritative guide for converting HyperCard stacks to LiveCode is still Jacque’s tutorial at https://www.hyperactivesw.com/mctutorial/rrtutorialtoc.html


Devin

Sendt fra min iPhone

2. des. 2018 kl. 23:27 skrev Ingar Roggen <***@sosiologi.uio.no<mailto:***@sosiologi.uio.no>>:


2. des. 2018 kl. 04.38 skrev J. Landman Gay via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>>:

As far as I know, LC includes all the scripted paint commands that HC had, and adds native color besides. The stacks I've imported that used painting commands worked with few changes, mostly only needing to slow them down due to LC's faster engine and more modern CPUs.

The OP wants to emulate MacPaint, so image size limitations probably won't be an issue.

--
Jacqueline Landman Gay | ***@hyperactivesw.com<mailto:***@hyperactivesw.com>
HyperActive Software | http://www.hyperactivesw.com
On December 1, 2018 7:53:03 PM hh via use-livecode <use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>> wrote:

Richard G. wrote:
... Is there anything in MacPaint that can't be done with LC's bitmap objects?

"That can't be done" wins always, because the only limit for LC is the sky
(more exactly, sadly, the sky below the 65535-limit for all coordinates).

But there's a lot of features that are not done with LC's bitmap objects.
Even in a comparison with the paint features of HC some are missing (which
of course can be done, because the limit ...).
_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
use-***@lists.runrev.com<mailto:use-***@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Richard Gaskin via use-livecode
2018-12-03 01:55:52 UTC
Permalink
Ingar Roggen:

> ...why not elaborate it to the tool, the app needed to make HC easily
> portable to LC and thereby accessible "to the rest of us" again?
> Anybody takes the challenge?

One could make HC's interface in LC. Anyone game?

I once thought about doing it myself...
http://livecodejournal.com/features/the-true-power-of-hypercard.html

--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
***@FourthWorld.com http://www.FourthWorld.com
J. Landman Gay via use-livecode
2018-12-03 04:45:20 UTC
Permalink
Someone on the HC list did just that many years ago using MC. I don't think
he ever finished it though, it turned out to be a lot of work and there was
little interest by then.

--
Jacqueline Landman Gay | ***@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On December 2, 2018 7:56:52 PM Richard Gaskin via use-livecode
<use-***@lists.runrev.com> wrote:

> Ingar Roggen:
>
> > ...why not elaborate it to the tool, the app needed to make HC easily
> > portable to LC and thereby accessible "to the rest of us" again?
> > Anybody takes the challenge?
>
> One could make HC's interface in LC. Anyone game?
>
> I once thought about doing it myself...
> http://livecodejournal.com/features/the-true-power-of-hypercard.html
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> ***@FourthWorld.com http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-***@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
Richmond via use-livecode
2018-12-03 09:15:56 UTC
Permalink
Did exactly that a couple of years ago . . . .

No takers at the time.

Richmond.

On 3.12.18 г. 3:55 ч., Richard Gaskin via use-livecode wrote:
> Ingar Roggen:
>
> > ...why not elaborate it to the tool, the app needed to make HC easily
> > portable to LC and thereby accessible "to the rest of us" again?
> > Anybody takes the challenge?
>
> One could make HC's interface in LC. Anyone game?
>
> I once thought about doing it myself...
> http://livecodejournal.com/features/the-true-power-of-hypercard.html
>
hh via use-livecode
2018-12-03 16:45:45 UTC
Permalink
> Hakan wrote:
> The code will not work if you have htmltext containing the text "color=" like:
> <p>To set the color you can use color="#fa3b42"</p>

Oh yes, was rather silly of me not to keep this in mind. There is a simple remedy:

put ("color=" is in fld 1) into isInField
if isInField then replace "color=" with numToChar(5) in fld 1 preserving styles
.. do the htmltext-method ..
if isInField replace numToChar(5) with "color=" in fld 1 preserving styles

what doesn't slow down if "color=" is in only a few lines.

> and you can also shave off some milliseconds in the styledText version by using foreach:
> …
> repeat for each key aKey in tTextA
> # Check if first run has textcolor set
> put (tTextA[aKey]["runs"][1]["style"]["textcolor"] is empty) \
> into tTextA[aKey]["style"]["hidden"]
> end repeat
> …
> For me that is always faster than your clever 'offset("color="…' version.

This may be true but the above doesn't work for the OP's question: To hide lines with
*any* textcolor property set, not only the textcolor for the whole line.

The styledText method is still very fast with the adjusted version below (make it better!).

For up to at about 2500 short lines the htmlText method is here still faster.
For more than 2500 short lines or if many text lines contain "color=" the styledText method
is faster.

The OP will simply take the version that is faster/better suited for his use case.

Here the two working methods that hide *exactly* the lines (more exactly: paragraphs)
of a field that contain no colored chunk.

-- styledText method
on mouseUp
put the millisecs into m1
lock screen; lock messages
put the styledText of field "text" into st
put st into tTextA
repeat for each key aKey in tTextA
put tTextA[aKey]["runs"] into T
repeat for each key I in T
put (T[I]["style"]["textcolor"] is empty) into tTextA[aKey]["style"]["hidden"]
end repeat
end repeat
set the styledText of fld "text" to tTextA
put the millisecs - m1 into fld "timing"
end mouseUp

-- htmlText method
on mouseUp
put the millisecs into m1
lock screen; lock messages
put ("color=" is in fld 1) into isInField
if isInField then
replace "color=" with numTochar(1) in fld 1 preserving styles
end if
put the htmltext of fld 1 into ht
set linedel to "<p"
put the htmltext of fld 1 into ht
replace " hidden" with empty in ht
repeat for each line L in ht
if offset("color=",L)>0 then
put "<p" & L after s
else put "<p hidden" & L after s
end repeat
set htmltext of fld 1 to s
if isInField then
replace numTochar(1) with "color=" in fld 1 preserving styles
end if
put the millisecs - m1 into fld "timing"
end mouseUp
hh via use-livecode
2018-12-03 17:05:21 UTC
Permalink
Sorry, the styledText method of my last post had a logic fault
(style-runs without textcolor are ignored).

The following works now for me.

-- styledText method
on mouseUp
put the millisecs into m1
lock screen; lock messages
put the styledText of field "text" into tTextA
repeat for each key aKey in tTextA
put tTextA[aKey]["runs"] into T
put true into isEmpty
repeat for each key I in T
put isEmpty and (T[I]["style"]["textcolor"] is empty) into isEmpty
end repeat
put isEmpty into tTextA[aKey]["style"]["hidden"]
end repeat
set the styledText of fld "text" to tTextA
put the millisecs - m1 into fld "timing"
end mouseUp

-- htmlText method
on mouseUp
put the millisecs into m1
lock screen; lock messages
put ("color=" is in fld 1) into isInField
if isInField then
replace "color=" with numTochar(1) in fld 1 preserving styles
end if
set linedel to "<p"
put the htmltext of fld 1 into ht
replace " hidden" with empty in ht
repeat for each line L in ht
if offset("color=",L)>0 then
put "<p" & L after s
else put "<p hidden" & L after s
end repeat
set htmltext of fld 1 to s
if isInField then
replace numTochar(1) with "color=" in fld 1 preserving styles
end if
put the millisecs - m1 into fld "timing"
end mouseUp
Continue reading on narkive:
Loading...