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 14 in printed book and digital formats -- plus a one-year subscription 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

PDF:

Feature

Scripting Interfaces

Adding a User Interface to Your RBScript

Issue: 10.4 (May/June 2012)
Author: Marc Zeedar
Article Description: No description available.
Article Length (in bytes): 10,538
Starting Page Number: 65
RBD Number: 10409
Resource File(s):

Download Icon project10409.zip Updated: Wednesday, May 2, 2012 at 1:27 AM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

As you probably know, RBScript is one of my favorite features of Real Studio. I have been using it more and more as it really makes my applications so much more powerful. It's a great way to externalize code so I don't have to recompile my entire project just to make a tiny change.

One key limitation of RBScripts is that they don't have a user interface. For many uses of RBScript that's not a problem—the script simply does the processing on data established from the main program. However, what if a script needs to ask the user a question?

I recently decided to enhance my "filename cleaner" app I created as part of my "Scripting for Fun and Profit" article in RSD 7.1. You'll remember that that app is a simple file renamer app that gets its instructions—how it renames—via external RBScripts, making it easy to customize for any need.

When I had a bunch of filenames with the same text in them which I wanted changed, I could have simply written a custom script to make that change. But what about the next time I had a similar situation? I'd have to edit my script every time I wanted to do a "find-replace" type rename. It would work far better if my script could ask for input and allow me, at runtime, to put in the old and new text for the filename.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com