Article Preview
Buy Now
FEATURE
Introducing PowerXS (Part 2)
A new tool to make XojoScript easier to use
Issue: 18.5 (September/October 2020)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 30,436
Starting Page Number: 12
Article Number: 18502
Resource File(s):
project18502.zip Updated: 2020-08-31 22:37:14
Related Link(s): None
Excerpt of article text...
Last issue, I introduced my PowerXS concept and provided a lot of background for how it works. If you're new to Xojo or XojoScripts, I'd highly recommend you read Part 1 of this series first. Today we're going to dive into a technical explanation of how PowerXS works.
I've marked this article as for "advanced" users, mostly because it's getting into the nitty gritty that may not interest everyone, so don't let that scare you off. It's not that complicated. If
I can understand it, anyone can!Digging Deep Into PowerXS
At its core, PowerXS creates a framework clone very similar to the way you'd do it manually. However, since part of it is automated, it needs to be done in a specific, consistent manner so that its details can be extracted via introspection.
Since I wanted my class to mostly work automatically, I didn't want to have to add a complex API to specify information about the cloned structure manually. So the first thing I did was to decide that the names of methods need to be created a certain way so that introspection can use that naming scheme to deduce details about the structure of the cloned class.
To do this, I first divided the methods that are inside PowerXS into two groups: PowerXS utilities—routines needed for the operation of PowerXS—and methods that are part of cloned frameworks. To separate these, PowerXS methods and functions are preceded with
pxs_
. They are also set as private, since XojoScripts don't need access to these routines.
...End of Excerpt. Please purchase the magazine to read the full article.