When I ask “What kind of variable are you?” I don’t mean “Are you an Integer, a String, a Variant, an Object?”. I am asking “are you a value type or a reference type?”. What’s the difference between the two?
December 3rd kicks off Computer Science Education Week 2018! Computer Science Education Week is held in early December every year in recognition of the birthday of computing pioneer Admiral Grace Hopper. Alongside this is the Hour of Code promotion where schools throughout the world get students to try at least 1 hour of programming at some point during the week.
Each year for Hour of Code, I volunteer at the local Middle School to talk to the students about what it is like to be a programmer and do a little bit of programming. This year I plan to demonstrate Xojo Dojo with a Raspberry Pi and show the kids how much fun coding can be.
In a previous entry we started to dig into web services with Xojo. The first post focused on the backend (server side), creating the Xojo app acting as middleware between the clients and the database that holds your data. We are using SQLite as the backend engine but it would not be difficult to change to other supported database engines like PostgreSQL, MySQL (MariaDB), Oracle or SQL Server, and even ODBC; all of these are supported by Xojo!
I started learning how to code as a teenager. Back then there weren’t very many programming languages. I remember BASIC, Pascal, Fortran, COBOL, C and a handful of others that were highly specialized. Why so few? Because in the 1970’s, computers just couldn’t do very much compared to today. The available languages were sufficient for the limited tasks computers had been assigned to manage.
Over the last several decades, computer technology has exploded. The smartphone I carry around in my pocket is far more powerful than the fastest computers of my youth. As a teenager, I rarely encountered anything where a computer had played a part. Today the rare encounter would be with things where computers had played no part. Computers handle so many tasks now that, as a natural consequence, there are thousands of programming languages with more appearing every year.
With so many languages, it can be difficult to choose one. What is important in a programming language?
The Canvas control is a great way to draw pretty much anything to a window. With a Canvas, do all your drawing in its Paint event handler for the best quality and performance.
I’ve had many people ask for an example for how to create a Canvas that allows you to:
- Draw pictures within it (as objects)
- Move these objects
- Remove them
- Add labels to them
- Programmatically select one
This example demonstrates how to do all these things. It has a large Canvas on the window with several buttons that let you add and manage the objects on the Canvas.
The WebCanvas control is used for drawing graphics in web apps. It takes advantage of the HTML5 Canvas making it fast and powerful. Sometimes is can be useful to be able to save the graphics drawn in the WebCanvas to an image file, but unfortunately there is no built-in Xojo method to do this.
Follow this tutorial to learn how to create active (clickable) words in a text of a TextArea control using the OOP Delegate design pattern, which allows you to dynamically change how your app will react when the user clicks on any of these active words. Best of all, this is cross-platform, so you can use it for macOS, Windows and Linux deployments!
It’s the first week of the Just Code challenge so I’m starting with something pretty simple. This app lets you choose a color using the system color picker and then shows you the color values in hexadecimal (useful for programming, HTML and CSS), RGB (red, green, blue), HSV (hue, saturation,value) and CMY (cyan, magenta, yellow).
Xojo is an Object Oriented Programming Language and, among other things, that means that it supports Methods Overloading. We have seen in other posts that some of these overloaded methods can be Class Constructors, but, there are others things you can do. For example, we can overload the operators. These are the methods in charge of adding two instances of the same class, subtracting, multiplying or dividing them. But we also have at our disposal another operator we can overload: Lookup. What advantages does this give us and how it does it work? Let’s explore it while building a Preferences class we can use in any of our projects.