Variable naming conventions

Today I came across an old document I created in June 2004 probably from some text I found on the internet or maybe from an old Xojo Forum post, to say the truth I am not sure where it comes from. Anyway, the thing is that the document in question is some kind of variable naming conventions now I realize I fully adopted it after reading it. This is what it recommends when naming things you are declaring in your code depending on their nature. For you to understand better, it is a list of heading characters you have to …

Continue Reading

Xojo NthField() and CountFields() functions in PHP

In Xojo there is a handy function I use quite a lot for getting substrings between given delimiters from a piece of text, it is: NthField(text, delimiter, fieldnumber) Imagine you have the following text “1/2/3/4”, NthField( “1/2/3/4”, “/”, 3 ) will return 3, that is the third substring between the “/” delimiters. It is that simple! This function works great in Xojo as long as the text is not too big. A few years ago I was porting a Xojo function to PHP that used NthField() so I decided to port the whole function. This is the PHP equivalent: function …

Continue Reading

Sorting a Popup menu with RowTags

Imagine you want to load a popup menu with the name of the files from a given folder, the user will later select an entry from that popup menu to load that file thanks to the file info we will store in the popup menu rowtag property. Now what if we want to sort the popup menu alphabetically? The solution is to load the data into a couple of arrays, sort those arrays together and then load the result into the popup menu. Given ‘f’ is the folder we want to display the items of, this is the code: Dim …

Continue Reading