BBC BASIC for Windows
« Object Class library - CLASSLIB »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:30pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 veryhotthread  Author  Topic: Object Class library - CLASSLIB  (Read 278 times)
Andy Parkes
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: Object Class library - CLASSLIB
« Reply #18 on: Mar 7th, 2014, 11:57am »

Hi folks,

I have made another change to CLASSLIBA that is possibly worth mentioning:

http://wiggio.com/yui/folder/stream_file.php?doc_key=ck73Bdku6hyAO+SzuM5KN0kYaKtjKAlqhvXG7mwovhQ=

The change allows arrays to be passed as arguments to methods (as is normal for other functions and procedures). For example, the following code does not work with CLASSLIB:

Code:
      INSTALL @lib$ + "CLASSLIB"

      DIM Class{method1, method2}
      PROC_class(Class{})
      PROC_new(Obj{},Class{})
      PROC(Obj.method1)
      PROC_discard(Obj{})
      END

      DEF Class.method1
      LOCAL a%(), A%
      DIM a%(10)
      FOR A%=1 TO 10
        a%(A%) = A%
      NEXT
      PROC(Class.method2)(a%())
      ENDPROC

      DEF Class.method2 (a%())
      LOCAL A%
      FOR A%=1 TO DIM(a%(),1)
        PRINT a%(A%)
      NEXT
      ENDPROC
 


I have also added a tiny bit more syntactic-sugar, but you can easily delete anything you find unnecessary.

Thanks

Andy
User IP Logged

Andy Parkes
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: Object Class library - CLASSLIB
« Reply #19 on: Mar 7th, 2014, 12:08pm »

Hi folks,

I found a bug immediately after uploading, so have deleted CLASSLIBA for the time being, and will upload it again later after its fixed.

Thanks

Andy
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Object Class library - CLASSLIB
« Reply #20 on: Mar 7th, 2014, 1:32pm »

on Mar 7th, 2014, 11:57am, Andy Parkes wrote:
The change allows arrays to be passed as arguments to methods (as is normal for other functions and procedures).

In case you thought otherwise, the inability to accept array parameters is a bug, not an intentional 'feature' of CLASSLIB! Clearly it needs to be rectified in the 'official' library, rather than being treated as an 'extension'.

I have therefore corrected CLASSLIB.BBC to accept arrays as formal parameters of methods. Version 0.95 may be downloaded from here.

Richard.
User IP Logged

Andy Parkes
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: Object Class library - CLASSLIB
« Reply #21 on: Mar 7th, 2014, 3:25pm »

Here is CLASSLIBA with it's spoonful syntactic-sugar:

http://wiggio.com/yui/folder/stream_file.php?doc_key=phUocicEhoLWSL0X5QClkwa8dRM+l0mRNT8+YQV1wfc=

Before uploading, I solved the issue with the same method, only implementing a FOR loop. Before that my failed attempt used INSTR thinking that I could achieve better performance, but it created some delicate situations. Now having now seen your solution, I have copied it as its more elegant, and it keeps CLASSLIBA fundamentally identical to CLASSLIB.

Many Thanks

Andy
User IP Logged

Andy Parkes
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: Object Class library - CLASSLIB
« Reply #22 on: Mar 7th, 2014, 3:55pm »

I did it again tongue

So, for the sake of completeness (its not as if it contains critical updates), here is CLASSLIBA:

http://wiggio.com/yui/folder/stream_file.php?doc_key=MHvXkkJzqZm9Mis20GYpjikqHzEoRjLcTFe1wSLHhYs=

Many thanks,

Andy
User IP Logged

rtr
Guest
xx Re: Object Class library - CLASSLIB
« Reply #23 on: Jun 4th, 2014, 5:46pm »

I have updated CLASSLIB to version 0.96. It may be downloaded from here:

http://wiggio.com/yui/folder/stream_file.php?doc_key=k9C2Uwcr44cRxCoB5hYp8Es3ZQD4l1C5v/GYieGLjow=

This version fixes a problem which could occur when a program using CLASSLIB was compiled (with the 'Abbreviate names' crunch option enabled).

Richard.
User IP Logged

Andy Parkes
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: Object Class library - CLASSLIB
« Reply #24 on: Jun 4th, 2014, 6:49pm »

I have also updated CLASSLIBA (a slightly modified version of CLASSLIB) to incorporate Richard's update.

CLASSLIBA is not as compact as CLASSLIB, but makes it easier to work with object pointers and has some support for copy-constructors.

http://wiggio.com/yui/folder/stream_file.php?doc_key=9FxQglg4syu5W4KR1Ba3hJmesWrn4gNlSfm3IRi6p0g=

Andy
User IP Logged

rtr
Guest
xx Re: Object Class library - CLASSLIB
« Reply #25 on: Jun 29th, 2014, 6:02pm »

I have updated CLASSLIB to version 0.97. It may be downloaded from here:

http://wiggio.com/yui/folder/stream_file.php?doc_key=02xpBZzIzSxTR0U77TYmt6AI715/o5ro7AZAIMUrFNI=

This version fixes a serious memory leak which could occur when a class contains a string member variable.

Richard.
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls