unexpected end of file error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miket214412345
    New Member
    • May 2013
    • 2

    unexpected end of file error

    i get an unexpected end of file at the line below that has databaseKeyValu e. Not sure why and how to fix it. Any help would be greatly appreciated.


    Code:
    private static bool addItemsToDrawing(
        Visio.Page drawingPage)
    {
        bool itemsAdded = false;
    
    // Add the shapes to the drawing page. The returned list contains
            // the shape IDs of the added shapes.
            Array shapeIDs;
            addShapesToDrawing(drawingPage, out shapeIDs);
    
            if (shapeIDs != null)
            {
                // Loop through each new shape, adding the shape to the map.
                for (int index = shapeIDs.GetLowerBound(0);
                    index <= shapeIDs.GetUpperBound(0);
                    index++)
                {
                    // Get the shape.
                    short shapeID = (short)(int)(shapeIDs.GetValue(index));
                    Visio.Shape newShape = drawingPage.Shapes.get_ItemFromID(shapeID);
    
                    // Add the shape to the map.
                    // This is needed to connect the shapes.
    
                    // The primary key in the database is used in the database
                    // connection table, so we need to save the mapping from 
                    // this database key to the corresponding shape. The 
                    // database key value was placed into each shape's Prop.ID 
                    // value when the database-linked shapes were added to the
                    // drawing.
                    int databaseKeyValue = newShape.get_Cells(_VisioPropCellPrefix + _IDColumn).get_ResultInt((short)Visio.VisUnitCodes.visNumber, 0);
    
                    _ItemShapeIndexMap.Add(databaseKeyValue, newShape.Index);
                }
    
                itemsAdded = true;
            }
        
    
        return itemsAdded;
    }
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    may be your error is not there, you have a missing curly bracket("{}") combination. In general missing curly bracket combination cause this error.

    Comment

    • miket214412345
      New Member
      • May 2013
      • 2

      #3
      if i am missing curly brackets wouldn't it not compile then? When i put breakpoints in the code it fails on that line.

      Comment

      Working...