Re: Rooting around in the Forum: destructors

2017-06-05 Thread Bob Sneidar via use-livecode
OOP is driven by the concept of classes and objects, and you cannot think that 
only means buttons and fields, user interface objects only. OOP means something 
quite different. Every thing you can refer to in an OOP environment MUST have a 
parent class. That is what I mean by, "driven". 

A Class is a definition for an object, a template if you will. You can create a 
hierarchical system of root classes and child classes that inherit some (or 
all) of the parent class properties. In fact if you expect to get very far, you 
*MUST* create that hierarchy before you do any coding. 

To create an object, you create an instance of a class. In an LC sense it would 
be like being able to create multiple templates of buttons, fields and menus 
that looked and acted differently, even for one off objects, and then create 
instances of them in such a way that if you edited a property of the parent 
class, say the textfont, all the children/instances of that class would also 
change. That is the magic of inheritance. But it means that you have to spend 
an inordinate amount of time planning and structuring you application before 
you begin creating any of it. Great care to follow good practices is necessary 
if you intend to go back and modify your class structure. 

Livecode has no class paradigm per se. You simply create copies of objects that 
have no backwards inheritance to the "parent" object or class. Indeed there is 
no parent. LC objects are orphans at birth. 

I have often though that it might be nice to create an OOP system from the 
scripting side, but the more I thought about it, the more complex I saw it 
would have to be. In the end it would be like building the foundation of a 
tower on top of the tower after the tower had already been built. 

Bob S


> On Jun 3, 2017, at 12:05 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> Thanks for the explanation: although, to be honest I've never really quite 
> worked out what the
> difference is between Object-oriented languages and Object-based languages (I 
> know that LiveCode is object-based).


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


Re: Rooting around in the Forum: destructors

2017-06-05 Thread Bob Sneidar via use-livecode
It's a scripting language. It's not the job of Livecode to do memory 
management. In fact it's hardly the job of modern apps to do it. The OS manages 
most of that. For us, the App is the livecode engine, and not our script. 

Bob S


> On Jun 3, 2017, at 09:46 , Richmond Mathewson via use-livecode 
>  wrote:
> 
> Not having looked at any sort of "serious" programming language since about 
> 1989 (I don't think that VB 6 is a serious language),
> I find it hard to understand what a destructor is beyond a way to free memory 
> on a system that has constraints in that area.
> 
> HOWEVER: as there is no thing in Livecode having "destrucor" written all over 
> it in big letters for slow characters
> like myself could some one tell me:
> 
> 1. Does Livecode have something(s) that does the job of a destructor?
> 
> 2. If so, where is it and so on?
> 
> 3. If not, why not?
> 
> Richmond.


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


Re: Regex help...

2017-06-05 Thread Thierry Douez via use-livecode
@Paul,
to defend you, it's not always so obvious to know what we can or cannot do
with regex.


@Mike
yes, Perl is great and that's certainly why I have embeded Perl in
LiveCode, Mmm, more than 10 years ago.

I've also helped some well known LiveCoders to do some complex
transformation with Perl where
they were lost in pure LiveCode script; but this is another story.

By the way, there is a not free LiveCode library called sunnYrex which
accepts LiveCode script inside
the replacement text.. pretty cool too but not useful in Paul use case.

Kind regards,

Thierry



2017-06-05 15:23 GMT+02:00 Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com>:

> Thank you Thierry and everyone else.
>
> I should have realized that I couldn't do this entirely with regex due
> to the need to compare the number values. It was a long day yesterday
> and my brain just wasn't in full gear.
>
> -- Paul
>
>
> On 6/5/2017 4:06 AM, Thierry Douez via use-livecode wrote:
> > Hi Paul,
> >
> >
> > AFAIK you need to deal with an hybrid approach (regex + livecode)
> >
> > So, here is one way to do it:
> >
> >
> >put 3 into pPage
> >
> >repeat for each line T in tCiCData
> >
> >   if matchText( T, "(?x) \t (\d+) , \d+ ,  (\d+)  , \d+ \z", n1, n2)
> > then
> >
> >   if (n1 <= pPage) and (n2 >= pPage) then
> >
> >   put T & cr after tCiCfilteredData
> >
> >   end if
> >
> >   end if
> >
> >end repeat
> >
> >put tCiCfilteredData
> >
> >
> > But for the curious with an open-mind here is another solution:
> >
> >
> >get "perl -ne 'print if /\t(\d+),\d+,(\d+),\d+$(?(?{$1>PP ||
> > $2 >
> >get replaceText( IT, "PP", pPage)
> >
> >put shell( IT && "/your/path/CiCData.txt")
> >
> > What? the regex do the comparison!
> > Well yes and no; in Perl we can embed Perl code *inside* the regex,
> > like: (?{$1>PP || $2 >
> > $1>PP || $2 >
> > As we have a mixture of a regex pattern and some perl code;
> > that is in fact another hybrid solution.
> >
> >
> > And of course, you can do it  using only chunks , item and so on...
> >
> > Have fun,
> >
> > Thierry
> >
> >
> > 2017-06-04 17:35 GMT+02:00 Paul Dupuis via use-livecode <
> > use-livecode@lists.runrev.com>:
> >
> >> I have a tab and cr delimited table of data, a sample line of which is
> >> below:
> >>
> >> 1Test4052,125941,4052,3,2388
> >>
> >> Can someone help me revise this regex to match what I need?
> >>
> >> Thank you kindly, in advance.
> >>
>

-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: Regex help...

2017-06-05 Thread Paul Dupuis via use-livecode
Thank you Thierry and everyone else.

I should have realized that I couldn't do this entirely with regex due
to the need to compare the number values. It was a long day yesterday
and my brain just wasn't in full gear.

-- Paul


On 6/5/2017 4:06 AM, Thierry Douez via use-livecode wrote:
> Hi Paul,
>
>
> AFAIK you need to deal with an hybrid approach (regex + livecode)
>
> So, here is one way to do it:
>
>
>put 3 into pPage
>
>repeat for each line T in tCiCData
>
>   if matchText( T, "(?x) \t (\d+) , \d+ ,  (\d+)  , \d+ \z", n1, n2)
> then
>
>   if (n1 <= pPage) and (n2 >= pPage) then
>
>   put T & cr after tCiCfilteredData
>
>   end if
>
>   end if
>
>end repeat
>
>put tCiCfilteredData
>
>
> But for the curious with an open-mind here is another solution:
>
>
>get "perl -ne 'print if /\t(\d+),\d+,(\d+),\d+$(?(?{$1>PP ||
> $2
>get replaceText( IT, "PP", pPage)
>
>put shell( IT && "/your/path/CiCData.txt")
>
>
> What? the regex do the comparison!
> Well yes and no; in Perl we can embed Perl code *inside* the regex,
> like: (?{$1>PP || $2
> $1>PP || $2
> As we have a mixture of a regex pattern and some perl code;
> that is in fact another hybrid solution.
>
>
> And of course, you can do it  using only chunks , item and so on...
>
>
> Have fun,
>
> Thierry
>
>
>
>
> 2017-06-04 17:35 GMT+02:00 Paul Dupuis via use-livecode <
> use-livecode@lists.runrev.com>:
>
>> I have a tab and cr delimited table of data, a sample line of which is
>> below:
>>
>> 1Test4052,125941,4052,3,2388
>>
>> Can someone help me revise this regex to match what I need?
>>
>> Thank you kindly, in advance.
>>


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


Re: Regex help...

2017-06-05 Thread Mike Bonner via use-livecode
Wow, the perl way is pretty darn cool.

On Mon, Jun 5, 2017 at 2:06 AM, Thierry Douez via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Paul,
>
>
> AFAIK you need to deal with an hybrid approach (regex + livecode)
>
> So, here is one way to do it:
>
>
>put 3 into pPage
>
>repeat for each line T in tCiCData
>
>   if matchText( T, "(?x) \t (\d+) , \d+ ,  (\d+)  , \d+ \z", n1, n2)
> then
>
>   if (n1 <= pPage) and (n2 >= pPage) then
>
>   put T & cr after tCiCfilteredData
>
>   end if
>
>   end if
>
>end repeat
>
>put tCiCfilteredData
>
>
> But for the curious with an open-mind here is another solution:
>
>
>get "perl -ne 'print if /\t(\d+),\d+,(\d+),\d+$(?(?{$1>PP ||
> $2
>get replaceText( IT, "PP", pPage)
>
>put shell( IT && "/your/path/CiCData.txt")
>
>
> What? the regex do the comparison!
> Well yes and no; in Perl we can embed Perl code *inside* the regex,
> like: (?{$1>PP || $2
> $1>PP || $2
> As we have a mixture of a regex pattern and some perl code;
> that is in fact another hybrid solution.
>
>
> And of course, you can do it  using only chunks , item and so on...
>
>
> Have fun,
>
> Thierry
>
>
>
>
> 2017-06-04 17:35 GMT+02:00 Paul Dupuis via use-livecode <
> use-livecode@lists.runrev.com>:
>
> > I have a tab and cr delimited table of data, a sample line of which is
> > below:
> >
> > 1Test4052,125941,4052,3,2388
> >
> > Can someone help me revise this regex to match what I need?
> >
> > Thank you kindly, in advance.
> >
>
> --
> 
> Thierry Douez - sunny-tdz.com
> sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
> ___
> use-livecode mailing list
> use-livecode@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-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


[ANN] This Week in LiveCode 85

2017-06-05 Thread panagiotis merakos via use-livecode
Hi all,

Read about new developments in LiveCode open source and the open source
community in today's edition of the "This Week in LiveCode" newsletter!

Read issue #85 here: https://goo.gl/rNyg18

This is a weekly newsletter about LiveCode, focussing on what's been
going on in and around the open source project. New issues will be
released weekly on Mondays. We have a dedicated mailing list that will
deliver each issue directly to you e-mail, so you don't miss any!

If you have anything you'd like mentioned (a project, a discussion
somewhere, an upcoming event) then please get in touch.


-- 
Panagiotis Merakos 
LiveCode Software Developer

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


Re: Regex help...

2017-06-05 Thread Thierry Douez via use-livecode
Hi Paul,


AFAIK you need to deal with an hybrid approach (regex + livecode)

So, here is one way to do it:


   put 3 into pPage

   repeat for each line T in tCiCData

  if matchText( T, "(?x) \t (\d+) , \d+ ,  (\d+)  , \d+ \z", n1, n2)
then

  if (n1 <= pPage) and (n2 >= pPage) then

  put T & cr after tCiCfilteredData

  end if

  end if

   end repeat

   put tCiCfilteredData


But for the curious with an open-mind here is another solution:


   get "perl -ne 'print if /\t(\d+),\d+,(\d+),\d+$(?(?{$1>PP ||
$2PP || $2PP || $2:

> I have a tab and cr delimited table of data, a sample line of which is
> below:
>
> 1Test4052,125941,4052,3,2388
>
> Can someone help me revise this regex to match what I need?
>
> Thank you kindly, in advance.
>

-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode