Click here to Skip to main content
15,991,949 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

public class xmlLinearLayout{
    private static void Layout();
    string  path = Assets.Resource.design.xml;
    set.view(path);
    onCreate();
    set.ContentView(path);
}
}
}


Error CS1519
Invalid token '(' in class, struct, or interface member declaration

Error CS8124
Tuple must contain at least two elements.

Error CS1519
Invalid token ';' in class, struct, or interface member declaration

Error CS1022 Type or namespace definition, or end-of-file expected

What I have tried:

removed } and added extras....
Posted
Updated 20-Dec-19 14:11pm
v3
Comments
Richard MacCutchan 21-Dec-19 11:06am    
The interpreter is fine, but I think you need to spend quite a lot of time learning C# properly.

1 solution

The "interpreter", as you call it, isn't an interpreter at all. The VS IDE, as quirky as it can be at times, is about the best in the industry. With all the mistakes you put into the code, it's catching every problem you're typing.

But, you've got single opening curly brace and 3 closing curly braces. You also have a single method with no code in it at all, and a misplaced semicolon on the end of that line. Method signatures never end with a semicolon and method bodies are always enclosed in curly brackets.

I think you're looking for something more like this:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

public class xmlLinearLayout
{
    private static void Layout()
    {
        string path = Assets.Resource.design.xml;

        set.view(path);
        onCreate();
        set.ContentView(path);
    }
}

Though, the calls to "set" and "onCreate" won't do anything except throw compile-time errors because it doesn't appear as though you have them defined anywhere. Also, you're missing a namespace line so the compiler may scream about that too.
 
Share this answer
 
v2
Comments
Keith.Harrie 20-Dec-19 19:00pm    
I need to define the view ?? cause I am not understanding defining set and onCreate.
Dave Kreskowiak 20-Dec-19 22:48pm    
I have no idea what kind of app you're writing. Windows Forms? WPF? ASP.NET? MVC? Console? ... and what do YOU mean by "view"?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900