Re: [Vala] const in Vala
- From: "Raphael Bosshard" <raphael bosshard gmail com>
- To: "Jan Niklas Hasse" <jhasse gmail com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] const in Vala
- Date: Tue, 2 Dec 2008 16:54:04 +0100
Hello Jan,
constants may only be declared outside methods. Try moving the bufferSize declaration out of the method, to the head of the file.
The error message is misleading nonetheless. I'd file a bug report. ;)
So long,
Raphael
On Tue, Dec 2, 2008 at 4:44 PM, Jan Niklas Hasse
<jhasse gmail com> wrote:
Okay:
public static string getline() {
const int bufferSize = 32;
string @return = "", buffer;
do
{
char[] temp = new char[bufferSize];
stdin.gets(temp);
buffer = (string)temp;
@return += buffer;
}
while(buffer.length + 1 == bufferSize);
return @return;
}
I'm using valac 0.5.1 on Windows.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]