What I learnt today

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.

Thanks for sharing Wayne as I now learned that also!!! :slight_smile:

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 :slight_smile:

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.

Ohhhhhh. Like!

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

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

Zzzzzzzzzz… :stuck_out_tongue_winking_eye:

[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 :slight_smile:

[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.

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.

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.

http://documentation.xojo.com/index.php/Keyboard_Shortcuts

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 !

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

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.

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

http://youtu.be/1yZmfPgH_NE

Yeah, I found that, I guess I was secretly hoping for more :slight_smile:

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.

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

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…