Why do I get the compile error "Too many characters in character literal"?
Author: seannieboy71
Creation Date: 11/28/2013 8:58 PM
profile picture

seannieboy71

#1
I am a total newbie at WealthLab. I am not a trained programmer but I do script some in Python for my job.

I tried to create a file using the line of code shown below and I get an error while compiling that states "too many characters in character literal". What am I doing wrong?

CODE:
Please log in to see this code.


Thanks
profile picture

Eugene

#2
You're getting this message because your line of code contains several syntax errors, probably because you're applying your Python skills to the entirely different domain. Please refer to your C# book, MSDN and the popular sites like Dotnetperls or Stackoverflow on proper syntax.

1. File.Create expects parameters to be enclosed in double quotes, not apostrophes.
2. "FileCreate" is not a valid method name.
3. File.Create is a void and does not return an integer code.
4. Also, this code needs a using directive (using System.IO)
5. DebugFile.txt needs to have a path defined, or you will get an insufficient file rights violation when trying to write into Wealth-Lab's main folder under Program Files (by default when no path is specified).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).