Bug? Formatting elseif

Discussion in 'Bugs & wishlist' started by kohle, Nov 23, 2018.

  1. kohle

    kohle Active Member Licensed User

    when i code elseif lines in the editor, it formats :

    If wDirection="r" Then
    else if wDirection="l" Then
    else if wDirection="t" Then
    Else If wDirection="b" Then
    End If

    Should it not be like this :

    if wDirection="r" then
    Else if wDirection="l" Then
    else if wDirection="t" then
    Else if wDirection="b" Then
    end If
    and for every end if I type I must click 2 times enter, because of this auto....
    This editor slows me so much down. I typing now in notepad++ and copy the text
    to get some speed.
  2. DonManfred

    DonManfred Expert Licensed User

    if you pres ENTER after each THEN it would be formatted correctly. Ok, may be only when you paste the variable from clipboard. If i write such a code like yours i usually have the variable copied...
    so i´ll write IF[space][pressing STRG-V to include the variable]
    it gets reformatted due to the pasted variable,

    You also can press ALT-F to force a new formatting at any time.

    If you copy the code from above and paste it into your app code it is formatted correctly too.
  3. sorex

    sorex Expert Licensed User

    doesn't pressing alt-f solve the formatting issue?

    I get what you're after with the endif. It would be nice if a linefeed could be assigned to some single line commands.

    you can optimize your code like this aswell

    Dim dir As String="b"
    Dim oDir As String="lrltbt"
    output: t
  4. kohle

    kohle Active Member Licensed User

    "if you pres ENTER after each THEN it would be formatted correctly"

    No this dont solve the formatting of elseif !

    Alt f works, but why cant this be automatically made after the last endif ?

    code ALT + F
    code ALT + F
    code ALT + F ..... ????

    and this :

    At the "THEN" command :
    if a=1 then (Here I must click always 2 x times ENTER , why ?????)

    First ENTER it highlights the if and then and the second enter outs an end if

    Normally you are used in other editors when you click enter you get in the next line.

    Can this if then ... can be turned off ?
  5. sorex

    sorex Expert Licensed User

    you only need to ALT-F once to reformat the current sub you're in.

    the 2 enters is

    1. confirm the autocomplete selection
    2. add line feed

    if you prefer 1 enter only you can use

    1. confirm with TAB
    2. add line feed with enter

    but it remains 2 keypresses.

    yes, you can turn it off with Tools > IDE > disable explicit autocomplete

    but that disables everything related to the autocomplete and that makes coding even slower.

    SHIFT+ENTER at the autocomplete seems to confirm and add a linefeed at once but you need to type THEN completely or it doesn't complete the word.
    Last edited: Nov 23, 2018
  6. kohle

    kohle Active Member Licensed User

    ok. thanks.

    when you work on a large code, like > 500 lines you have to use ALT + F more than once,
    not only at the end of coding .

    And if a variable is not declared first, and you try to type like a=3 , oh man, something comes out of the auto correction,
    you need to click first esc ....

    I think for beginners is this editor cool, but for a experience developer who works with different languages its tricky.

    I dont need a auto complete for IF..THEN, FOR..NEXT or the other basic stuff.

    Maybe a option in the configuration would be nice .
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice