A favor please?

I need someone to put together a snippet of code for me. This code does NOT have to do anything, it just needs to be syntacially correct.
And include as many variations of

  • FOR/NEXT (including examples with STEP and DOWNTO in various combos)
  • DO LOOP (with UNTIL on both ends)
  • WHILE/WEND
  • EXIT FOR/WHILE/DO etc… for both inner and outer situations
  • TRY/CATCH/FINALLY
  • DIM/VAR … various datatypes, arrays, with/without default values
  • IF/THEN … single line and with END IF (and ELSEIF conditions)
  • SUB/FUNCTION
  • SELECT CASE
  • END SUB|FUNCTION|SELECT etc

This is to be a test script for my BASIC -> Swift translator… I want someone else to put it together so I do not subconsciously create “easy” scenarios…

What I am looking for now is just those commands that define the STRUCTURE of a program. And if you can think of any other “structure” related keywords, please add them too…

I appreciate any time that anyone is willing to invest in this for me :slight_smile:

Heh you missed “GOTO” :slight_smile:
yes there are still places where I see it being used
Although Swift should have no issue with that one

GOTO/GOSUB were purged from my vocabulary years ago.
Swift doesn’t support a direct correaltion to GOTO, and of course GOSUB is just calling a method (which is by name, not “label”)

Ironically Swift DOES require the use of labels for an “EXIT” that is more than one layer away. (Swift uses the keyword BREAK instead)

loop1:
for i in(0...10) {
   for j in(0...10) {
        break loop1 // just "break" would exit J loop, this exits I loop
   } // next j
} // next i

labels such as these are not required unless the break is more than one layer deep

Do you still need it or did Norman already sent you something?

Does anyone know why Sweden stopped reporting cases?

see https://www.worldometers.info/coronavirus/country/sweden/

Wrong thread?

But I would guess the numbers were skyrocketing

Nobody has provided any examples yet… and not sure what COVID has to do with this topic :slight_smile:

I’ll finish what I’m doing in a couple of minutes and will write some code for you.

Thanks… as I said it doesn’t need to do anything, just compile, and contain as many variations of Xojo “structure/control” type commands

I have a hard time getting anything I write to compile but I’ll do my best LOL

Oops - sorry, thought I was in the COVID-19 thread … :flushed:

Do you need some nested loops?

yes… with breaks and continues and all that nasty stuff :slight_smile: