
New in this prerelease of the 25.1 plugins:
Download:
monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.
You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.
Let's a look on the for-each loops in Xojo. They allow you to loop over a container data type very easily. That could be:
- The entries in an array.
- The keys in a Dictionary or the entries.
- The FolderItems in a folder.
- The rows in a Listbox or a RowSet.
- The sessions, pages, controls, labels and views in the Web framework.
- The characters or code points in a string.
To iterate over a container, it must implement the Iterable interface and return the new iterator object, which implements the Iterator interface. Xojo has over 20 classes built-in, that implement these interfaces.
(more)
Today the new books arrived from XDevMag. Always great to have all the articles from one year of the Xojo Developer Magazine in one book, where you can just browse through when you have some time in your hammock.
We'll give away a few over the year at various Xojo meetings
If you like to get one yourself, you can order them in the XDevMag book store. When you consider ordering them, better pick several years and let them ship together at a package price. There are also academic and subscriber discounts available and shipping from USA or Europe is available.
If you like SQLite and you look for a server version, you quickly find CubeSQL. If you like to connect to it using MBS Xojo SQL Plugin, you can use the SQLDatabaseMBS or SQLConnectionMBS class.
First you need to get a CubeSQL client library. Within our plugin is the built-in library, which you can activate using InternalCubeSQLLibraryMBS module. Otherwise you can of course use a libcubesql.dylib/so/dll of your choice.
(more)
Meet someone via QR code or file
Let us point you to an article in the Xojo Developer Magazine in the 22.6 issue:
In this article, Stefanie Juchmes discusses how to embed vCard contact information into a QR code, offering a way to easily transfer contact details between smartphones. The concept is inspired by a conference experience where a QR code on a name badge allowed participants to quickly access a person's contact details. Rather than simply linking to a website, the article focuses on embedding a vCard (an electronic business card) directly into a QR code, allowing users to add the contact information directly to their address book.
The article provides a deep dive into the structure of a vCard, explaining its key components and how to format them properly for inclusion in a QR code. Key pieces of data in a vCard include the person’s name, email, phone numbers, address, URL, birthday, and notes, with examples of how each should be written. The process also involves handling optional fields and ensuring proper formatting with line breaks. The article illustrates this with sample code for creating a vCard and discusses how to store it within a QR code for easy sharing.
Finally, Stefanie shows how to implement this QR code generation using the MBS Xojo Barcode Plugin in Xojo, walking through the steps to create a QR code and save it either as a file or for display. The user interface (UI) allows for the entry of contact details, which are then used to generate the vCard data. She also explains how to handle file-saving options, allowing users to save their contact information as a .vcf file or generate a scannable QR code. The article concludes with an invitation to experiment with this tool for sharing contact information at future events.
see also BarcodeGeneratorMBS class.
Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.
(more)
Using Overlays with MBS
Let us point you to an article in the Xojo Developer Magazine in the 22.5 issue:
This article introduces the concept of using overlays with the MBS Xojo Plugins, which are customizable screen areas that can be freely moved, resized, and interacted with through mouse events such as clicks and hover actions. The example in the article demonstrates how to create and manage an overlay using the OverlayMBS class. The author walks through the process of setting up an overlay, defining its position, size, and background, using a logo as an example. The article also discusses how to apply masks to hide unwanted parts of the image, achieving effects like removing white edges around a logo.
Further functionality is explored, such as making the overlay movable or resizable by the user and controlling its visibility through methods like Show, Hide, and Close. The overlay’s opacity can be adjusted using a grayscale mask or the Alpha property. The author also highlights the use of shadows and the ability to update the overlay dynamically, for instance, by adding text fields and drawing text on the overlay with customized font properties. This feature allows for creating information boxes or interactive elements within an application.
Finally, the article delves into the various events associated with the OverlayMBS class, including focus-related events, mouse interaction events, and window visibility events. These events enable developers to add advanced interactivity, such as detecting mouse movements, clicks, or focus changes. The author concludes by offering a practical tip to help users track event triggers, enhancing their understanding of overlay behavior in their applications. The techniques covered aim to help developers integrate dynamic and interactive overlays into their Xojo applications.
see OverlayMBS class.
Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.
(more)
Recently a beginner asked about the differences between the loops and which too choose. Let's compare the loops by using them to count up from a start to an end value.
The first loop is the FOR loop. It counts a variable up from a start value to the end value. If the start value is bigger than the end value, the loop is skipped entirely. Let us show you the sample code:
Sub testFor(First as Integer, Last as Integer)
For i As Integer = First To Last
Log "For "+i.ToString
Next
End Sub
You are not limited to double, but you can use any data type you like, e.g. a double. Here we step by 0.3 instead of the default 1, so we count up from 1.0 to 2.8. After 2.8 comes 3.1 which is too big, so the loop exists.
(more)
Using Appleās Vision to Extract Text from an Image
Let us point you to an article in the Xojo Developer Magazine in the 22.4 issue:
In this article, Stefanie Juchmes introduces how to use Apple’s Vision framework to recognize text within images on Mac and iOS systems using the MBS Xojo Plugins in Xojo. She explains the general capabilities of the Vision framework, such as recognizing text, barcodes, and classifying images into categories. The main focus of the article is text recognition, which can be achieved through Apple's Vision functions. The process begins with loading an image into the program using an open dialog, then passing the image to a method called VisionOCR. Depending on the macOS version, the method will either recognize the text's bounding boxes (on older versions, 10.13 and 10.14) or extract the actual text (on macOS 10.15 and higher).
The article provides detailed steps on handling different macOS versions and what functionalities are available for text recognition. On macOS 10.13 and 10.14, Vision can detect text positions but does not recognize the actual text, while macOS 10.15 and above can identify both the text and its position. The code snippet presented demonstrates how to detect text and its bounding boxes and how to handle errors using the VNRecognizeTextRequestMBS and VNDetectTextRectanglesRequestMBS methods. Additionally, the author explains how to store results and draw polygons around detected text areas on the image, which helps visualize the recognized regions.
Finally, the article covers how to extract the actual text from the image on macOS 10.15 and above, determine an appropriate font size, and display the recognized text on the image. The results can be output as text or processed further in a text field. The author also shows how to draw the image with the text onto a canvas, scaling it appropriately for display. This allows developers to integrate text recognition into their apps, making it easier to process and display text from images on macOS and iOS platforms.
Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.
(more)
Today we like to connect to Postgres Database server from Xojo using MBS Xojo SQL Plugin. For that we need the client libraries for Postgres, but where to get them?
macOS
For macOS you can download the Postgres App to get a local test server for Postgres on your Mac. You can directly point to the libpq.5.dylib within the application.
We adjusted the install names to make them work into the Frameworks folder of your application. The libpq library needs crypto and ssl libraries, so these must be in the same folder. You can find these with a test project here: PostgreSQL Libraries. You can add a these using a CopyFiles build step into the Frameworks folder of your application.
Var con As New SQLConnectionMBS
Var cmd As New SQLCommandMBS
Var ResourceFolder As FolderItem = SpecialFolder.Resources
Var ContentsFolder As FolderItem = ResourceFolder.Parent
Var FrameworksFolder As FolderItem = ContentsFolder.Child("Frameworks")
Var LibFile As FolderItem = FrameworksFolder.child("libpq.5.dylib")
If LibFile.Exists = False Then
MessageBox "libpq not found?"
End If
con.SetFileOption con.kOptionLibraryPostgreSQL, LibFile
(more)
What are they and how to use them
Let us point you to an article in the Xojo Developer Magazine in the 22.3 issue:
This article introduces readers to Phidgets, small input/output devices developed by Phidgets Inc. that can be used for a variety of applications such as sensors for humidity, light, pressure, temperature, and more. The article explains how to connect these devices to a computer through hubs, either wired or wireless, and how the MBS Xojo plugin can facilitate interaction between Phidgets and Xojo software. The author walks through the process of creating a weather station with a light sensor, barometer, and temperature sensor, demonstrating how to gather data from these sensors and display it in a Xojo interface.
The setup for working with Phidgets involves connecting them to the computer through hubs, with each hub offering multiple ports. In a Xojo project, the layout includes elements like label fields to display data from sensors and buttons to control the program. The author walks through the process of adding a library for Phidgets in the program, ensuring that the necessary code is in place to load and use the library for communication between Xojo and the Phidgets hardware. This is followed by a demonstration of how to initialize and configure the sensors using specific Phidget classes and handle events triggered by sensor data changes.
Finally, the article explores how to control data updates from sensors to avoid unnecessary changes being triggered too frequently. This is accomplished by adjusting properties such as data interval and change triggers to control when events are fired based on meaningful changes in sensor data. The program includes a button to close the Phidgets connection properly and end the session. The article concludes with a reminder of the steps taken, providing a comprehensive guide for readers interested in integrating Phidgets with Xojo for hardware interfacing projects.
see Phidgets plugin and Phidgets classes.
Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.
(more)

New in this prerelease of the 25.1 plugins:
Download:
monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.
You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.
How to determine the location of devices with MBS under Windows and Mac
Let us point you to an article in the Xojo Developer Magazine in the 22.6 issue:
The article "Find Yourself" by Stefanie Juchmes explains how to determine the location of a device using MBS Xojo Plugins for both Windows and Mac platforms. On Windows, the process involves using the WindowsLocationManagerMBS class to request access to location data and start event handling. The article outlines how to create a class that inherits from this class, use the StartEvents method, and handle location updates through the LocationChanged event. It covers different status reports like whether location services are not supported, errors, or when the location service is running, allowing the application to react appropriately.
For Mac, the location retrieval process works similarly, using the CoreLocation framework and the CLLocationManagerMBS class. The process starts by checking if location services are available and enabled on the device. The class created in the Mac example inherits from CLLocationManagerMBS, and location updates are retrieved through the didUpdate event. Latitude, longitude, altitude, and timestamp can be fetched, and the article also touches on querying the data in a formatted text string, which can include speed, direction, and accuracy metrics. The process is straightforward, similar to the Windows implementation, with a focus on handling location updates and stopping them once the data is retrieved.
In addition to basic location retrieval, the article also explores advanced functionality on Mac, like using a GeoCoder to convert geographic coordinates into a street address. The author explains how to set up a GeoCoderHandler class to handle the completion event once the geocoding process is finished. This feature allows the user to obtain both address information for a set of coordinates and vice versa, making it versatile. By providing detailed examples and code snippets for both platforms, the article gives readers a comprehensive understanding of how to use MBS to get location data and even turn coordinates into readable addresses on Mac.
see CLLocationManagerMBS and WindowsLocationManagerMBS classes.
Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.
(more)
Using EmailParser
Let us point you to an article in the Xojo Developer Magazine in the 22.1 issue:
In this article, Stefanie Juchmes provides an introduction to parsing emails using Xojo and the MBS Xojo CURL Plugin. She explains the process of reading and analyzing email content by first obtaining the email in an "eml" file format. This can be done by exporting it from an email application like Apple Mail. The email is then loaded into the program using the MimeEmailMBS class, which can be initialized with different file types such as a MemoryBlock, String, or FolderItem. Once the email is loaded, various properties such as the subject and received date are accessed to extract basic information.
The article goes on to describe how to access more detailed content of the email, including plain text and HTML format, using properties like PlainText and HTMLText. It highlights the role of inline graphics in emails, especially in advertising, and shows how to retrieve information about these graphics using the Inlines property. Each inline graphic is represented by a MimeAttachmentMBS object, and the code allows the user to extract file names and other details. The section also explains how to handle email attachments similarly by accessing the MimeAttachmentMBS objects and determining the file types using the MimeType property.
Finally, the article covers how to analyze the email's header to gather details about the sender, recipients, and other metadata. Using the MimeHeaderMBS class, the article demonstrates how to extract the sender's and recipient's addresses, including the ability to handle multiple addresses in fields like bcc, cc, and to. The StringValue property is used to retrieve these as strings, while the Addresses method provides more detailed information. The article concludes with a suggestion to explore further email features in another article by the author, focusing on sending emails with inline graphics in the headers and footers.
Please subscribe to the Xojo Developer Magazine and read this article and the ones coming later this year.
(more)
You have XSLT 1.0 in FileMaker and Xojo built-in as well as in our plugin function to use XSLT (XML.ApplyStylesheet). With our Saxon functions you get XSLT 3.0 and you can enjoy all the 2.0 and 3.0 features in your FileMaker solution and Xojo applications.
XSLT 2.0 and 3.0 introduce several significant improvements and new features compared to XSLT 1.0. Here are the key benefits of XSLT 2.0 and 3.0 over XSLT 1.0:
(more)
Please check out our SortMBS module. It contains optimized array methods for a few things. These functions are highly optimized and usually magnitudes faster than doing it in Xojo code yourself.
We have these functions overloading arrays directly:
method AddMBS(extends array1() as Type, array2() as Type)
method CopyMBS(extends source() as Color, dest() as Color, sourceIndex as Integer = 0, sourceCount as Integer = -2, destIndex as Integer = 0)
method EqualsMBS(extends array1() as Type, array2() as Type, array1offset as Integer = 0, count as Integer = -2, array2offset as Integer = 0) as Boolean
method ReverseMBS(extends theArray() as Type)
method SortMBS(extends theArray() as Type, descending as Boolean = false)
method SortMBS(extends theArray() as Type, theDelegate as SortVariantDelegateTypeMBS, descending as Type = false)
method SumMBS(extends source() as Type, sourceIndex as Integer = 0, sourceCount as Integer = -2) as Int64
The math functions like sum are implemented for Boolean, Currency, Double, Int32, Int64, Single, UInt32 and UInt64. The AddMBS function will append the values to another array. The CopyMBS will copy from one array to another array, optionally only a range of values.
(more)

New in this prerelease of the 25.1 plugins:
Download:
monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.
You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.

You may know that we have plenty of classes for Bonjour on macOS, iOS and Windows. For Linux we have the Avahi classes to browser for services. In our plugin version 25.1 we add new Avahi classes to register a service. What you use this for?
You may do an application for your Raspberry Pi to run there as a service. How to find the IP to connect over the network? If you use Avahi, your application can start the ServerSocket and get the port it uses. Then advertise this on the network and your other application on a different computer and look for the service and learn what IP and port to connect this. All automatically for IPv4 as well as IPv6.
link
(more)

New in this prerelease of the 25.1 plugins:
- Added optional Names parameter to BuiltInCurves function in ECKeyMBS class.
- Added CurveNameToID function to ECKeyMBS class.
- Added ES256Verify and ES256Sign functions to ECKeyMBS class.
- Added CustomerID property to DynaPDFMBS class.
- Added Failed event to WebView2ControlMBS control to report when a WebView2 could not be created.
- Improved GZipMBS class to handle unicode characters in the file path.
- Updated CURL library to version 8.12.0.
- Warning: CURL 8.12 has a bug with STARTTLS for SMTP causing a server timeout. We implemented a workaround until an official fix is available.
Download:
monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.
You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.
I got asked what the differences between XLS and XSLX formats are for our LibXL functionality. Some of the features are only available if you opted for the new or old format. In general we nowadays prefer the newer XLSX format based on XML.
Here is a table to compare:
What | XLS | XLSX |
File Format | Binary Interchange File Format (BIFF) | Office Open XML Format |
Compatibility | Readable by all Microsoft Excel versions | Readable by Excel 2007 and later versions |
Rows | up to 65,536 rows | up to 1,048,576 rows |
Columns | up to 256 columns | up to 16,384 columns |
Formulas | Supports older Excel functions | Better compatibility with newer Microsoft Excel functions (such as IFERROR, XLOOKUP, TEXTAFTER) |
Maximum Number of Fonts | 504 | 65429 |
Conditions Formats | no | yes |
Pictures | yes | yes |
Picture Links | no | yes |
Cell Comments | yes | no |
Auto Filter | no | yes |
Data Validation | no | yes |
Form Controls | no | yes |
Check out the XL functions for our MBS FileMaker Plugin and the XL classes in our MBS Xojo Plugins, which allow you to read and write Microsoft Excel files using LibXL library.

New in this prerelease of the 25.1 plugins:
- Added AddSysPath method to PythonMBS class.
- Added AvahiAddressResolverMBS, AvahiEntryGroupMBS, AvahiHostNameResolverMBS and AvahiRecordBrowserMBS classes.
- Added mitigation against buffer overflow in Windows for snprintf function.
- Added more methods and properties for AVCaptureDeviceMBS class.
- Added PHPickerControlMBS control.
- Added ReverseMBS function for arrays.
- Added SetLicense, License and ClearLicense methods for SaxonMBS module.
- Added SourceWithoutAttachments method to MimeEmailMBS class.
- Added State property to AvahiClientMBS class.
- Added View and ViewController properties to PHPickerViewControllerMBS class.
- Added WindowsAVIWriteMBS class.
- Changed SetLicenseKey in XLBookMBS class to raise exception if you pass invalid license, e.g. Windows license on macOS, instead of ignoring it.
- Fixed a memory leak in AddInkList, InkAnnot and SetAnnotQuadPoints methods in DynaPDFMBS class.
- Fixed a memory leak of a DynaPDFRectMBS object when calling UpdateWindow event in DynaPDFRasterImageMBS class.
- Fixed crash in SortByFileName method in FileListMBS class introduced in v25.0.
- Fixed PopOverWidth and PopOverHeight for PHPickerViewControllerMBS class.
- Improved MidiPlaybackMBS class to raise exceptions if it wasn't initialized properly.
- Improved Optimize() function in DynaPDFMBS class to automatically set kofInMemory flag if you have no open file.
- Improved TrueItemsMBS function to be quicker.
- Removed dependency to CXXABI_1.3.13 for Linux, introduced in 15.0.
- Updated DynaPDF library to version 4.0.97.274.
- Updated lcms library to version 2.17rc0.
- Updated SQLite to version 3.48.0.
- Updated avahi library.
- Improved setting Baudrate in SerialPortMBS class to not try to change if the baud rate if the old and new rate are the same.
- Implemented keep alive for MQTT feature in CURLSMBS class. Use OptionTCPKeepAlive property to enable.
Download:
monkeybreadsoftware.de/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared DropBox folder.
You can subscribe to our Xojo mailing list to get notified for new pre-release and release versions.