Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 18.5 ('OOP Listbox')
Instant purchase and download via GumRoad!

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):

Download Icon 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.