MS LOOP Not Preserving Code Syntax

Copper Contributor

I wrote up a pretty detailed account of this here, but Microsoft Loop (the app) is modifying code when pasted into its code blocks, ultimately excluding white spaces in lines before readable characters.

 

Basic example showing code in original state:

 

 

 

def fizzbuzz(n):

    if n % 3 == 0 and n % 5 == 0:
        return 'FizzBuzz'
    elif n % 3 == 0:
        return 'Fizz'
    elif n % 5 == 0:
        return 'Buzz'
    else:
        return str(n)

print "\n".join(fizzbuzz(n) for n in xrange(1, 21))

 

 

 

 

When copying the above code from any app (tried several including Notepad) into Loop, the result is below:

PGSystemTester_0-1711315455025.png

Note the lack of indentation on each return line.

 

While this is visually undesirable, it's especially problematic for languages like python given its required spacing syntax.  If one were to then copy the same code BACK from Loop into a Python program, this code would not work.

 

Again the article on other board goes into far more depth, but figured it out to be shown here too.

3 Replies
I cannot access your detail account link due to my documentation. However, reviewing your syntax example, using if, get, call functions the %, ?, / with periods as = the assumption model of reference. That said, if 'a letter' 'what integration asked' to 'define the variable' is an assumption in a training sandbox environment to prevent machine language interference. Best not to loop certain functions.
Thanks for the headsup on the broken link. I believe it's been fixed, but here is the full link: https://answers.microsoft.com/en-us/officeinsider/forum/offinsd_loop-offinsdsub_win/ms-loop-not-pres...

I also think there may have been some confusion as I was referring to the APP Microsoft Loop, not coding a loop (we likely are not the first people to have this conversation, unfortunate to name an app a coding term).
text editor settings, compile settings, app interface connectors. H1 does not equal H2 as H3 compiles H1. White spacing being the question to review.