Search found 336 matches

by bwmilby
Fri Sep 18, 2020 1:49 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

ScriptOnly stacks are the way to go for shared code. Much of the IDE is implemented that way. In your project you will just need to be sure are all referenced in the Stack files tab of the stack properties. Having many files open is not an issue for LC but many projects can be self contained in a si...
by bwmilby
Mon Sep 07, 2020 3:32 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Whole numbers
Replies: 26
Views: 937

Re: Whole numbers

When you ask “is an integer” you are actually asking if the value can be coerced to an integer which is why 3.0 and “3” report true. When you ask “is strictly” then the engine looks at how the value is actually stored without an attempt to coerce the value to the type. (Essentially what Mark said.)
by bwmilby
Sun Sep 06, 2020 3:32 am
Forum: LiveCode Builder
Topic: Composed Widgets limitations
Replies: 15
Views: 878

Re: Composed Widgets limitations

Not having viewed the widget code, I may be way off. I would think it would be better to have ‘octaves’ as a property for the widget (or notes) and just draw the requested number in the base widget instead of composing them like you are describing.
by bwmilby
Fri Sep 04, 2020 7:54 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

The compare on GitHub isn't working like I would expect it to. Here's a current view of the differences between my copy of the main stack script of the OOPEngine and Mark's (created with DeltaWalker). The first difference is the removal of the extra handlers that are commented out (83-148 in Mark's)...
by bwmilby
Fri Sep 04, 2020 12:01 am
Forum: Databases
Topic: update database
Replies: 13
Views: 5752

Re: update database

I think the comma is missing after the 4 and 5.
by bwmilby
Thu Sep 03, 2020 8:11 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

My latest code will always be here: https://github.com/bwmilby/OOPEngine Mine is in the master branch and Mark's will be in the mark branch. My code has been updated a little since what I posted earlier here. I've merged in the idea of creating different types of objects. I've also pulled in the reg...
by bwmilby
Wed Sep 02, 2020 4:59 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

Andrew, You can't mix passing and direct calls on the same handler. Also, you never can pass up the chain by name unless you use the class version. What Mark was referring to is more like the following: Class A with subclass B with subclass C. A defines someFunction. B also defines someFunction but ...
by bwmilby
Tue Sep 01, 2020 4:02 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

I'm going a little outside my experience, but I think that you would always want to include the base handler name. When anything outside of class code talks to the object, shouldn't it be using the base name and not the class specific version? So when the app wants to tell the object to reportBehav ...
by bwmilby
Fri Aug 28, 2020 9:12 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

Believe me, I tried to get to a general mechanism that would reliably traverse the class hierarchy with the fewest parameters that I could. If you are not careful and not explicit, then LiveCode's "Target" mechanism takes over and you don't end up where you expect (at least not where a C++ programm...
by bwmilby
Thu Aug 27, 2020 4:36 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

Here is a demo that I was working on to show the difference between dispatching to an object and the behavior of the object. ClassDemo.png (I manually added the bold to indicate the button clicked) Read the log from the bottom to the top (so Blue was the first button clicked) Here is the code for th...
by bwmilby
Tue Aug 25, 2020 3:02 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

I've pushed the update that allows script only stacks to be registered as classes: https://github.com/bwmilby/OOPEngine/commit/8047dad7ee9bf759a8bca7dae3d9760090c016ab The link is to the commit so you can see the actual code changes that we made. Here is the most relevant handler addition: command r...
by bwmilby
Tue Aug 25, 2020 1:02 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

You cannot call a function/command up the hierarchy with the same name and have control return. Passing the target only lets the abstract class code know which object it is dealing with, it does not allow access to the private variables that are instantiated for the object. You can use “pass” to all...
by bwmilby
Mon Aug 24, 2020 1:39 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

@Mark I replied in the PR. I’ll put more here later this evening. One thing I’m working on is registering stacks as classes. I wrote the code last night but didn’t get to test it. This would allow easy inclusion of relevant classes in a project. If the class needed to encapsulate some other binary o...
by bwmilby
Sun Aug 23, 2020 4:37 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

I've been tracking all of the code for OOPEngine in this thread in a Git repository on my computer. I decided to go ahead and publish it on GitHub to make it easier for others to view/compare. There are 2 branches currently. My changes (based on Mark's initial update) are in the master branch. All o...
by bwmilby
Sat Aug 22, 2020 3:15 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 9062

Re: Equivalent of classes in LiveCode

Changes to linked list: local sCreateTime command LinkedList <snip> put the milliseconds into sCreateTime end LinkedList function getCreateTime return sCreateTime end getCreateTime Here is my button code: on mouseUp local tList1, tList2 put newObject("list1", "LinkedList") into tList1 put the name o...

Go to advanced search