# What I learnt today

**URL:** <https://forum.xojo.com/t/what-i-learnt-today/15370>\
**Category:** General\
**Created:** [March 31, 2014, 9:10am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370 "2014-03-31T09:10:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [March 31, 2014, 9:10am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/1 "2014-03-31T09:10:12Z")

</div>

I picked up a tip from Norman (as usual) about how to set a “watch” item in the debugger. Simply change the property to a computed property & place a break point in the setter.

This is so simple yet so powerful that I couldn’t help but share - it came as a comment from XDC which unfortunately I couldn’t attend.

Please share what you’ve learnt today.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 31, 2014, 7:17pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/2 "2014-03-31T19:17:33Z")

</div>

Thanks for sharing Wayne as I now learned that also!!! 🙂

---

<div class="post-metadata">

**Author:** ![Gavin\_Smith](https://forum.xojo.com/user_avatar/forum.xojo.com/gavin_smith/32/13901_2.png) [@Gavin\_Smith](https://forum.xojo.com/u/Gavin_Smith)\
**Post date:** [March 31, 2014, 8:05pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/3 "2014-03-31T20:05:56Z")

</div>

I didn’t learn this today but I did learn it recently, from one of Paul’s webinars I think: Xojo (and probably RS and RB before it!) will close code blocks for you. So, if you’re creating an If condition, just press Shift-Return after Then and Xojo will fill in the End If and leave the insertion point correctly positioned. The same applies for other blocks such as Select Case, Do Loop etc.

16 years of using this product and I never knew 🙂

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [March 31, 2014, 8:36pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/4 "2014-03-31T20:36:40Z")

</div>

There was also a dream (not an announcement or plan, AFAIK) expressed at XDC that the compiler would be able to fix simple errors for you too, like a missing “Then” and the like. That would be nice.

---

<div class="post-metadata">

**Author:** ![Underwriters\_Technologies](https://forum.xojo.com/letter_avatar_proxy/v4/letter/u/ed655f/32.png) [@Underwriters\_Technologies](https://forum.xojo.com/u/Underwriters_Technologies)\
**Post date:** [March 31, 2014, 8:44pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/5 "2014-03-31T20:44:51Z")

</div>

Ohhhhhh. Like!

---

<div class="post-metadata">

**Author:** ![Peter\_Truskier](https://forum.xojo.com/user_avatar/forum.xojo.com/peter_truskier/32/243_2.png) [@Peter\_Truskier](https://forum.xojo.com/u/Peter_Truskier)\
**Post date:** [March 31, 2014, 8:58pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/6 "2014-03-31T20:58:13Z")

</div>

> [@75518:@Jay Menna](#):
>
> Ohhhhhh. Like!

Me too, though if it doesn’t work perfectly, it could be more trouble than it’s worth…

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [March 31, 2014, 9:02pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/7 "2014-03-31T21:02:37Z")

</div>

Since it’s just a dream at the moment, you can imagine that it works perfectly. 🙂

---

<div class="post-metadata">

**Author:** ![Peter\_Truskier](https://forum.xojo.com/user_avatar/forum.xojo.com/peter_truskier/32/243_2.png) [@Peter\_Truskier](https://forum.xojo.com/u/Peter_Truskier)\
**Post date:** [March 31, 2014, 9:10pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/8 "2014-03-31T21:10:41Z")

</div>

> [@75527:@Kem Tekinay](#):
>
> Since it’s just a dream at the moment, you can imagine that it works perfectly. 🙂

Zzzzzzzzzz… 😜

---

<div class="post-metadata">

**Author:** ![Richard\_Gorbutt](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_gorbutt/32/261_2.png) [@Richard\_Gorbutt](https://forum.xojo.com/u/Richard_Gorbutt)\
**Post date:** [March 31, 2014, 9:32pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/9 "2014-03-31T21:32:28Z")

</div>

[quote=75502:@Gavin Smith]I didn’t learn this today but I did learn it recently, from one of Paul’s webinars I think: Xojo (and probably RS and RB before it!) will close code blocks for you. So, if you’re creating an If condition, just press Shift-Return after Then and Xojo will fill in the End If and leave the insertion point correctly positioned. The same applies for other blocks such as Select Case, Do Loop etc.

16 years of using this product and I never knew :)[/quote]

Almost on WIndows, If I type an IF block already nested inside another IF block. so I go IF a \> b, or whatever, then press Shift-Return, I don;t get the THEN and END IF, just END IF, however if not nested, I get the THEN and END IF. Burned me once or twice when I’m on a coding roll. Haven’t tried this on my Mac yet.

Needs to be a good summary of these shortcuts somewhere 🙂

---

<div class="post-metadata">

**Author:** ![Oliver\_Scott-Brown](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/8baadc/32.png) [@Oliver\_Scott-Brown](https://forum.xojo.com/u/Oliver_Scott-Brown)\
**Post date:** [March 31, 2014, 10:47pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/10 "2014-03-31T22:47:58Z")

</div>

[quote=75502:@Gavin Smith]I didn’t learn this today but I did learn it recently, from one of Paul’s webinars I think: Xojo (and probably RS and RB before it!) will close code blocks for you. So, if you’re creating an If condition, just press Shift-Return after Then and Xojo will fill in the End If and leave the insertion point correctly positioned. The same applies for other blocks such as Select Case, Do Loop etc.

16 years of using this product and I never knew :)[/quote]  
Also note that shift enter adds then to the end of your if statement. It has probably been at least a year since I have written an if statement on one line. I find it cleaner to write if statements with and end if.

---

<div class="post-metadata">

**Author:** ![Oliver\_Scott-Brown](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/8baadc/32.png) [@Oliver\_Scott-Brown](https://forum.xojo.com/u/Oliver_Scott-Brown)\
**Post date:** [March 31, 2014, 10:53pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/11 "2014-03-31T22:53:31Z")

</div>

> [@75516:@Kem Tekinay](#):
>
> There was also a dream (not an announcement or plan, AFAIK) expressed at XDC that the compiler would be able to fix simple errors for you too, like a missing “Then” and the like. That would be nice.

That would be nice if Xojo was perfected with more important improvements. If you forget your thens then you use the shift enter shortcut key.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [March 31, 2014, 10:55pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/12 "2014-03-31T22:55:39Z")

</div>

In 16 years, I don’t think I’ve used shift-enter once even though I’ve known it was there. I use option-return though, and missed it enough from Real Studio to implement it myself through AppleScript.

---

<div class="post-metadata">

**Author:** ![Paul\_Lefebvre](https://forum.xojo.com/user_avatar/forum.xojo.com/paul_lefebvre/32/3152_2.png) [@Paul\_Lefebvre](https://forum.xojo.com/u/Paul_Lefebvre)\
**Post date:** [April 1, 2014, 2:48am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/13 "2014-04-01T02:48:29Z")

</div>

> [@75560:@Richard Gorbutt](#):
>
> Needs to be a good summary of these shortcuts somewhere 🙂

[http://documentation.xojo.com/index.php/Keyboard\_Shortcuts](http://documentation.xojo.com/index.php/Keyboard_Shortcuts)

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [April 1, 2014, 7:55am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/14 "2014-04-01T07:55:07Z")

</div>

> [@75516:@Kem Tekinay](#):
>
> There was also a dream (not an announcement or plan, AFAIK) expressed at XDC that the compiler would be able to fix simple errors for you too, like a missing “Then” and the like. That would be nice.

Not the compiler, but what I would call the syntax checker.

If so, it would be nice if it place the missing Then (and others) where it belongs So, the next time it will not have to do that anymore !

---

<div class="post-metadata">

**Author:** ![Alwyn\_Bester](https://forum.xojo.com/user_avatar/forum.xojo.com/alwyn_bester/32/23099_2.png) [@Alwyn\_Bester](https://forum.xojo.com/u/Alwyn_Bester)\
**Post date:** [April 1, 2014, 8:41am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/15 "2014-04-01T08:41:58Z")

</div>

> [@75638:@Emile Schwarz](#):
>
> Not the compiler, but what I would call the syntax checker.

Usually a lexical analyzer passes tokens to a parser that checks the syntax of the language.

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [April 1, 2014, 9:57am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/16 "2014-04-01T09:57:07Z")

</div>

Well this hasn’t worked quite how I intended. The Shift+Enter shortcut is very useful I’ll admit, but the dream doesn’t really help my productivity today - I think my tip which originally came from Norman was tweeted by Kem & I’d really like to thank him for his efforts at XDC.

Perhaps this conversation should have been titled “Tips for Xojo Productivity” or perhaps “Tricks with Xojo IDE”.

There are often little gems that appear (usually from Norman because he’s so active here) that just give me the D’Oh moment.

One of these was in a conversation about sorting items in the Navigator - the answer was why? Just use the filter to find your object - do it a couple of times & you wonder why you missed it - well I did anyway.

Another one is resetting the Navigator - position the mouse cursor to the right of the “Contents” title (all the way over next to the editor) & you’ll see “Hide” - click now & all the contents are closed - do it again and this time it’s “Show” - click that and all your folders/objects are shown closed.

The really big trick I learnt when migrating from RS to Xojo is “Use Folders”, you need to organise your project. With an organised project the Navigator is your friend, without organisation you fight with it all the way. And it really makes life easy too. For example in WE projects I like my “pages” to be centred - I do this by creating a webcontainer with my controls then centre that on the webpage. So by having both the page & the container in a folder it’s really easy to manage that page.

The thing about these is they are “obvious” after you start using them, but for me at least not so much until they were pointed out.

And I’m sure there’s a whole lot of stuff you all do that is “obvious” because you just do it that could be shared - Xojo staffers especially.

---

<div class="post-metadata">

**Author:** ![Paul\_Lefebvre](https://forum.xojo.com/user_avatar/forum.xojo.com/paul_lefebvre/32/3152_2.png) [@Paul\_Lefebvre](https://forum.xojo.com/u/Paul_Lefebvre)\
**Post date:** [April 1, 2014, 12:44pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/17 "2014-04-01T12:44:49Z")

</div>

I’ll also point out the Xojo Power User IDE Tips webinar:

[http://youtu.be/1yZmfPgH\_NE](http://youtu.be/1yZmfPgH_NE)

---

<div class="post-metadata">

**Author:** ![Richard\_Gorbutt](https://forum.xojo.com/user_avatar/forum.xojo.com/richard_gorbutt/32/261_2.png) [@Richard\_Gorbutt](https://forum.xojo.com/u/Richard_Gorbutt)\
**Post date:** [April 1, 2014, 3:13pm UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/18 "2014-04-01T15:13:14Z")

</div>

> [@75619:@Paul Lefebvre](#):
>
> [http://documentation.xojo.com/index.php/Keyboard\_Shortcuts](http://documentation.xojo.com/index.php/Keyboard_Shortcuts)

Yeah, I found that, I guess I was secretly hoping for more 🙂

The Shift-Return inside a nested IF… THEN is busted in Windows but works ok on my Mac. When I get time I will file or check feedback.

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [May 18, 2014, 12:22am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/19 "2014-05-18T00:22:28Z")

</div>

Quite by accident today I discovered + M extends the current line to a new line in the code editor. Is this a windows only shortcut?

BTW not mentioned at [http://documentation.xojo.com/index.php/Keyboard\_Shortcuts](http://documentation.xojo.com/index.php/Keyboard_Shortcuts)

---

<div class="post-metadata">

**Author:** ![Jon\_Ogden](https://forum.xojo.com/user_avatar/forum.xojo.com/jon_ogden/32/494_2.png) [@Jon\_Ogden](https://forum.xojo.com/u/Jon_Ogden)\
**Post date:** [May 18, 2014, 3:35am UTC](https://forum.xojo.com/t/what-i-learnt-today/15370/20 "2014-05-18T03:35:41Z")

</div>

What I don’t like that I am seeing recently is what happens inside nested IF/Then blocks. If you have an If/Then statement and then add another one, the IDE will assume that the End If statement for the original If/Then now belongs to your new If/Then. This is a pretty new and annoying behavior. Anyone else find this bothersome? It applies to any nested statements…

[Next page](https://forum.xojo.com/t/what-i-learnt-today/15370.md?page=2)
