Announcement

Collapse
No announcement yet.

Duplicate LOCAL Name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Duplicate LOCAL Name

    Can someone explain why this duplicate of a name in the API is a problem? I thought explicitly declared LOCAL variable name duplicates were allowed.

    #INCLUDE "WIN32API.INC"
    FUNCTION MyFunction()
    LOCAL WndClass AS WndClassEx
    .
    .
    .
    Error 466 ...(705:11): Duplicate name definition: WNDCLASS
    Line 705: LOCAL wndclass AS WndClassEx

    It compiled without error after changing "wndclass" to "MyWndClass"

  • #2
    William,

    WNDCLASS is already defined as a UDT in win32api.inc, so there is a naming conflict. You cannot name variables with names that are already in use. The same would happen if you defined TYPE MYCLASS, FUNCTION/SUB/MACRO MYCLASS, or LOCAL/GLOBAL/DIM MYCLASS AS [..], as the name "MYCLASS" can only be used once.
    Last edited by Kev Peel; 15 Jan 2008, 05:46 PM.
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      No Problem

      Thanks Kev,
      I was hoping for a NAMESPACE or MODULE qualifier syntax but the limitation is easy to live with.

      Comment

      Working...
      X