Gambas Code Snippets

NOTICE: When Google forced the update of Google Sites, all the formatting and highlighting of my code examples was lost. Please bear with me while I try to restore all the code snippets to their colorful glory.

  • GAMBAS TextEdit Soft Return (Gambas2) One day I decided to create a small editor using TextEdit. I discovered that the line spacing was much more than I like. With word processors there is something called a Soft Return where you can move to the next line without a large space. To do this, one uses SHIFT and RETURN. But the TextEdit control uses only the <p> </p> html tags which creates an equivalent of a Hard Return and not the <br> which is the equivalent of a html Soft Return. The following code is what I came up with to give the TextEdit a soft return.

  • GAMBAS Leap Year Function (Gambas 2) This is a couple examples of functions to test for a leap year. The first example returns the number of days in the month of February and the second example returns a Boolean value (True/False) if rather or not the year is a leap year.