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