A recent thread on the forums discussed why a particular bit of code would not compile he felt the error message seemed less than helpful: “CRghtColr As Color = Color.RGBA(000,061,255,208)”.
Comments closedAuthor: Norman Palardy
With today’s multi-core CPU’s it seems that an application made with Xojo running on a single core is somewhat restricting. If you have a lot of data to process, large images to manipulate or other things that could happen in the background, it would seem that with a multi-core machine you could do this faster “if only Xojo would make threads preemptive”. We get a lot of requests for preemptive threads so that people can take advantage of multiple cores.
Comments closedA constructor is a special method that is used to initialize a class. They are very handy, but when you use them with control subclasses you have to be aware of how a control’s properties are initialized. Perhaps you’ve run into this situation:
“I have a constructor on my control and the values that I set in the constructor don’t stick.”
Comments closedMany times we get bug reports or feature requests about issues with keywords not highlighting or being colorized in the code editor. But are those words actually language “keywords” or reserved words in Xojo?
In reality none of the intrinsic types are reserved words. They’re just types in the global namespace. Xojo knows where a type name is required and it will only look for types in that context. The opposite holds true as well. In effect, the types are treated as if they live in their own namespace.
Comments closedThe other day I was asked: “Dumb question of the day! An Event Definition can have a Return Type defined. What is the syntax for RaiseEvent to make use of the Return Type?”
But this isn’t a dumb question at all since there are actually two valid ways to do this. I find one more obvious than the other. Here are both solutions so you can decide for yourself:
Comments closedWikipedia says:
In computer programming, a constant is a value that cannot be altered by the program during normal execution, i.e., the value is constant.
In Xojo we have constants that can be defined in code or added to modules, classes, etc. What you’ll notice about Wikipedia’s definition of “constant” is that it’s a behavior, not a specific type.
There is another way to define a “constant” or “a value that doesn’t change throughout the run of your application”.
Comments closedA question on the Xojo Forum got me thinking that it may not be obvious how to avoid having to reach inside another window (or dialog etc.) to access its controls to get and set values. I’m sure we all have done this at one time or another but it really is something you should avoid. Here’s a small app to demo how to make an API instead:
Comments closedRecently there was a question posted on the Xojo Forum about why a protected property on a control subclass could not be manipulated by an event handler in an instance event handler.
Comments closedIt’s a simple, quick way to work with your Xojo code with SVN.
Comments closedFrom time to time we get code that illustrates a problem a user is having when they rely on old-school ASCII. This problem can occur when using the Chr function to create a character.
One example we see reasonably frequently is code to create a string that contains a quote like:
dim someString as String = chr(34) + "someValue" + chr(34)
This style is not necessary and may give unwanted results if you have an unusual string encoding. Instead, you can write this without the use of the Chr function. Here’s how:
Comments closed