I made a minimalistic Xojo reference for beginners

URL

Screenshot

8 Likes

Just looking at the screenshot and the first entry: Append.
Uses Dim instead of the more modern Var
Uses Ubound which has been deprecated.

Other things are deprecated. (MsgBox)It should probably made clear that this tool is for older versions of Xojo.

1 Like

Canā€™t open it unfortunately.

Funny, I didnā€™t know that ā€œGoToā€ still exists ā€¦ I might want to ā€œsurpriseā€ some co-workers in the next days :-). More seriously: this might be helpful for some beginners, but should indeed be converted to API v2, or this version should be declared what it is: API v1. One column for APIv1 and one for APIv2 might be helpful as well.

2 Likes

I have been using 2011r4.3, because the .exe files generated by the versions after 2011r4.3 are very huge. For example, an simple application,

2011r4.3 ā€“ 4.8MB
2016r1.1 ā€“ 25.7MB

So I continue to use this very old version. :slight_smile:

1 Like

While Iā€™m sure we all understand your reasoning, 99% of Xojo users are using 2019r1 or later so you really should make your guide for API2 if you want it to be useful.

And at some point you will need to upgrade yourself any way. I donā€™t know why thereā€™s such a big difference in the size of the exe but Iā€™m sure it is for a good reason. And anyway, the size of an app hardly matters these days.

3 Likes

Thanks, friend. Iā€™m a newbie and I could use all the help I can get, minimalistic or otherwise. Iā€™ve had this file for ten minutes and Iā€™ve already used it. Somebody pointed out the ā€œgo toā€ command in your list. Thatā€™s a trip. You just know Iā€™m going to try it right away. Havenā€™t typed a ā€œgo toā€ since VB 6 but I suddenly realize how Iā€™ve missed it.

1 Like

That was me ;-). nothing wrong with GoTo if your app works, all is fine. But when you will dive a bit more into Xojo you will soon realize that it is rather a bad idea to still using it in 2020. of course it might help while converting a vb6 project but there are more powerful ways to structure your code. the Xojo documentation of Goto shows you a few concerns.

Gotoā€™s are famous to cause leaks due to internal flaws handling scopes. A goto jumps to places without releasing resources because the user could potentialy ā€œjump backā€ and a expected value is now gone. Something by these lines, and sh*t happens at some point. How to avoid such kind of problem? Donā€™t use Gotos.

1 Like

Very good point but I think Gotos are still important for app end users doing simple Xojo scripts that donā€™t have the structure of a full blown app, and in which app end users donā€™t really understand what a class or module is.

I havenā€™t used GOTO since I stopped writing FORTRAN in 1978.

2 Likes

Didnā€™t like FORTRAN. I found COBOL easier but always liked BASIC. Would you believe in 1979-81 at high school they introduced us to all three? No idea why that was necessary.

Last time I used GOTO in Atari Basic, it was 35 years ago.

1 Like

For high level languages, nope. People should just learn how to structure well their code. For Assembly? Yes, ā€œJumpsā€ are necessary, they mostly do the THEN and ELSE of the low level.

1 Like

While I likely wonā€™t use it myself, I applaud your effort to share and contribute. Keep up the great work! :slight_smile:

2 Likes

I liked FORTRAN. Personally I found FORTRAN and BASIC to be very similar. For years after that I did mostly COBOL. You could certainly write mor readable code back then in COBOL. The one thing I hated about it was the ALTER statement whcih allowed you to change where the GOTO jumped. A real nightmare to debug.

2 Likes

I am just landing on Xojo (Iā€™m deciding if it is the most appropiated language to migrate my old (and not so) applications from vb6 and I am laughing with the ā€œGOTOā€ discussion. I usually didnā€™t use it and usually I dont tell anybody to use it, but maybe there is a pair of exceptions: I used it to activate the error control (On Error GoTo ErrorManagement), using it a Tryā€¦Catch block like.

And also when an only jump helps to simplify a process structure. I agree with you about lot of jumps is the hell, but I found it useful sometimes when I had to re-execute a piece of code difficult to refactorize without adding more complexity (i.e. jumping from half a loop to repeat some steps but not the entire process). I donā€™t mean that jump is the only solution, but for that case is easier and I prefer it before complicating the trace with a set of subroutines and recursive calls.

1 Like

Hey guys, whatā€˜s wrong with ā€žgotoā€œ, does it not work properly?

I think Xojo (previously Real Basic) was initially very close to vb sintax but it is leaving, deprecating many words and functions. I suppose a class function like XXXXX.ToString is more eficient than the CStr equivalent, but what about Dim and Var? I think there is no difference and compiler can use both of them. Why to deprecate Dim? Same with Global and Public. It seems as Xojo tries to run away from its ā€œvb6 likeā€ label and to be close to ā€œvb.netā€.

Define ā€œproperlyā€. In high level languages using ā€œgotoā€ is not advised, and should be avoided in favor of structured flow. And besides causing unreadable code, it potentially can cause problems if you donā€™t know what youā€™re doing. Sometimes it can cause scope leaks.