#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    18
    Rep Power
    0

    IDE not allowing a certain variable name?


    I'm trying to use the identifier PoliceIncidentNumber in Delphi 2009 as a variable name.
    I get as far as typing PoliceInc and the IDE auto completes

    PoliceInc(i, );

    This happens even in a brand new blank project but even searching google finds no reference to a routine called PoliceInc()

    I cannot overwrite the (i, );

    Any idea what is going on?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    57
    Rep Power
    11
    It seems delphi is completing the code due to it thinking you want to call the inc method.

    http://www.delphibasics.co.uk/RTL.asp?Name=Inc

    I would assume it does the same for any variable containing the letters "inc". Perhaps you can confirm.

    I cannot overwrite the (i, );
    Isn't it possible to go to the end of the line (after delphi autocompleted it) remove all up to PoliceInc (using backspace only) and then continue typing the rest?

    if not, then yes its weird indeed
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    18
    Rep Power
    0
    Originally Posted by dve83
    It seems delphi is completing the code due to it thinking you want to call the inc method.

    http://www.delphibasics.co.uk/RTL.asp?Name=Inc

    I would assume it does the same for any variable containing the letters "inc". Perhaps you can confirm.



    Isn't it possible to go to the end of the line (after delphi autocompleted it) remove all up to PoliceInc (using backspace only) and then continue typing the rest?

    if not, then yes its weird indeed
    Yes, I can go to the end and delete backwards so I am left with PoliceInc but as soon as I type the next 'i' of Incident I get the beep and an auto complete again.
    I did find that I can write PoliceIncidentNumber in notepad and then copy / paste that into the IDE and it accepted it. Just can't write it in the IDE.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    18
    Rep Power
    0
    Originally Posted by dochsm
    Yes, I can go to the end and delete backwards so I am left with PoliceInc but as soon as I type the next 'i' of Incident I get the beep and an auto complete again.
    I did find that I can write PoliceIncidentNumber in notepad and then copy / paste that into the IDE and it accepted it. Just can't write it in the IDE.
    And yes, trying to name a variable FredIncident gave me the same autocomplete to generate FredInc(i, );
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    57
    Rep Power
    11
    Goto
    Tools-Options-Editor-Options-Code Insight

    perhaps you can find something here to prevent code completion without you invoking it via Ctrl + Space

    Perhaps turn off the "autocomplete" setting (you can always use Ctrl + Space) to request completion.

    Im not on 2009 version, perhaps see if you options look like the ones below.
    http://privat.rejbrand.se/codecompletion.png

    not perfect, but perhaps it helps
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    18
    Rep Power
    0

    IDE not allowing a certain variable name?


    Originally Posted by dve83
    Goto
    Tools-Options-Editor-Options-Code Insight

    perhaps you can find something here to prevent code completion without you invoking it via Ctrl + Space

    Perhaps turn off the "autocomplete" setting (you can always use Ctrl + Space) to request completion.

    Im not on 2009 version, perhaps see if you options look like the ones below.
    http://privat.rejbrand.se/codecompletion.png

    not perfect, but perhaps it helps
    Thanks for your interest.. My Options are identical to yours. I tried turning off code completion completely but it made no difference. But I did find that it doesn't matter where in the identifier the Inc appears, so FredInc or just Inc still produce the (i, ) . However it only happens if I press 'i' afterwards. So I cannot call a variable FredInci but I can call it FredIncx (or any other letter following the FredInc

    I've also found that it also happens if I try to uses FredInci as a type or even a const, as soon as I type the 'i'

    very odd.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    South Africa
    Posts
    57
    Rep Power
    11
    very odd indeed. surely a bug in the IDE.

IMN logo majestic logo threadwatch logo seochat tools logo