In binary the high bit (the one immediately following the &b in Xojo code) is the “sign bit”. When it’s set to 1, the value is interpreted as “negative” and when it’s set to 0, the value is “positive”. Meaning that bit is not used as part of the “number” itself.
Comments closedCategory: Learning
Code doesn’t care whether you are new to programming or an old pro, a citizen developer or the head of engineering, some missteps can catch any of us. Read on to learn some of the most common programming pitfalls and how to avoid them.
Comments closedXML can sometimes be a bit confusing, so here are some tips to help you work with XML files.
First, you need to make sure your XML is really XML.
Comments closedWhen you add a control such as a PushButton to a Window (or a WebButton to a WebPage or an iOSButton to an iOSView), an instance of the control is created for you and added to the layout. Code that is in the event handlers of a control added in this way can refer to both its own properties and methods as well as the properties and methods of the window.
Comments closedA lot of times you’d think that single lines of code, aka “one-liners”, like
if j >= 145 condition then dosomething()
or
if condition then return
might not have any downsides. I would argue that they do.
Comments closedIt’s very usual to use encrypted SQLite databases in our Xojo projects where we expect to get the maximum read speed from them. But the truth is that encrypting the data in these databases can introduce a penalty in our queries, both from read and writing/updating data to them. How can we improve this? One technique is the creation of a new in-memory based SQLite database, where we will be able to copy the table (or tables) we are interested in getting the maximum speed possible with. Continue reading to see how to do this.
Comments closedDo you need code to delete the files and folders from the selected folder? In that case, there is a technique I propose to you and that is based on recursion. That is, the ability of a function to call itself repeatedly until the task is complete; in this case, the function will call itself every time it detects a new folder/directory inside the designated original folder/directory.
Comments closedSometime ago a Xojo user asked if it is possible to use Xojo Web to create the kind of animated menus seen in several regular websites. After some investigation (and the invaluable help of Greg O’Lone), the answer is: yes, you can do that! If you are interested in seeing how to achieve this, continue reading!
Comments closedThere was a curious question on the forums about what # meant.
And from the way it was asked I could see the asker was thinking “I know what If means but what about that # in front of it?” And that if they knew what the # meant that the entire thing would make more sense.
And that’s a fair thought – except for one problem. The # by itself doesn’t “mean” anything. It isn’t like *, ^, + or – in that sense. It’s not an operator.
Comments closedA reader asked me to clarify something about my previous post. Their question was:
Comments closedWhen MyMethod is written as:
Sub MyMethod( i() as integer ) i = array(10,20,30) system.debuglog CurrentMethodName + " i(0) = " + str(i(0)) + " i(1) = " + str(i(1)) + " i(2) = " + str(i(2)) End SubWhat happens if instead of trying to assign a new array you just alter the values in the array passed in?