Jump to page: 1 24  
Page
Thread overview
Some errors
Jul 08, 2002
Juarez Rudsatz
error with printing
Jul 08, 2002
Juarez Rudsatz
Jul 11, 2002
Walter
Error with charset
Jul 08, 2002
Juarez Rudsatz
Jul 12, 2002
Walter
Jul 12, 2002
Walter
error with char[].sort
Jul 08, 2002
Juarez Rudsatz
Error with private?
Jul 08, 2002
Juarez Rudsatz
Jul 19, 2002
Walter
error with string concatenation
Jul 08, 2002
Juarez Rudsatz
error with module statement ?
Jul 08, 2002
Juarez Rudsatz
Jul 25, 2002
Walter
Jul 25, 2002
Pavel Minayev
Jul 25, 2002
OddesE
Jul 25, 2002
Pavel Minayev
Jul 26, 2002
OddesE
Jul 30, 2002
Walter
error message with linking
Jul 08, 2002
Juarez Rudsatz
error message of switch and empty strings
Jul 08, 2002
Juarez Rudsatz
Jul 09, 2002
anderson
debug and semantic
Jul 08, 2002
Juarez Rudsatz
Jul 31, 2002
Walter
Aug 01, 2002
Juarez Rudsatz
Aug 01, 2002
Walter
Aug 01, 2002
Juarez Rudsatz
Aug 01, 2002
Russell Lewis
Aug 05, 2002
Juarez Rudsatz
Aug 08, 2002
Walter
Aug 05, 2002
Juarez Rudsatz
Aug 08, 2002
Walter
unittest and import
Jul 08, 2002
Juarez Rudsatz
debug and import
Jul 08, 2002
Juarez Rudsatz
Aug 01, 2002
Walter
Aug 01, 2002
Juarez Rudsatz
Aug 02, 2002
anderson
Aug 04, 2002
Walter
July 08, 2002
D people :

I have found some errors during a simple program coding.
I dont know if are errors or misunderstanding, but you could evaluate and
give a final word.
The error are in the nexts post in this thread.

Juarez Rudsatz
July 08, 2002
module erro1;

import c.stdio;

void main(){

	// First error : comparing strings with slices
	char[]	s = '1234';

	printf(s[0..3] ~ \n);

	if ('124' == s[0..3])
		printf('Test 1');
	else
	if ('123' == s[0..3])
		printf('Test 2');
	else
	if ('124' === s[0..3])
		printf('Test 3');
	else
	if ('123' === s[0..3])
		printf('Test 4');
	else
		printf('Failed');

	// second error : constant string permited in if

	if ('value')
		printf(\n'Test 5'\n);

	// next error : semicollon list permited in if
	if ('value' , s[1..2], 987)
		printf('Test 6'\n);


	// Last error : switch with no case allowed
	switch(s){
		default:
	}

}
July 08, 2002
module error2;

import c.stdio;

void main()
{

// -> D outputs strings in ASCII codepage and not ANSI on windows

	printf("Portuguese special chars : áàãâéèêíóõôú" ~\n);

// D outputs \n not as \n\r in Windows

printf("Execute this program and redirect to a file:\n error > output.txt");

}
July 08, 2002
module error3;

import c.stdio;

void main()
{
// Bug on sorting strings

	char[][] string;

	string.length = 2;

	string[1] = 'cba';

	string[0] = 'zyx';

	// This sorts the strings
	string.sort;

	// This will crash the compiler
	string[0].sort;

	// This will give sintax error
	//string[0].sort();

	printf(string[0]);
	printf(string[1]);

}
July 08, 2002
module error4;

class Xyz
{
	private void SetParam(char[] option)
	{
		// no call for SetParam must be a error ?
	}

}

void main()
{

}

July 08, 2002
module error5;

char[] returnSameString(char[] inputstr)
{
	return inputstr;
}

// This gives a error
char[] passString()
{
	return returnSameString('First string' ~ "Concatenated with second");
}

char[] butThisWorks()
{
	char[] s = 'First string';
	s = s ~ "Concatenated with second";
	return returnSameString(s);
}

main()
{

}
July 08, 2002
module error12345;

// The module stament could be ommited or wrong typed. // Is this right ?

void main()
{

}
July 08, 2002
module error7;

/* 	When compiling only this module gives some linking error
	A better message "No main function" for novices ?
    	Is too hard?
*/

class Xyz { }
July 08, 2002
module error8;

void main()
{

	char[] s;

	s = '';

	// Error message to ugly
	switch(s)
	{
		case 'a' : return;
		case 'b' : return;
	}

}
July 08, 2002
module error9;

void main()
{

	char s;

	debug(5)
	{
		// Semantical errors are not detected in debug.
		// Only syntatical are. How I can assure if a
    	    	// program is debugable?

		s.Value.Anything.Value();
	}

}
« First   ‹ Prev
1 2 3 4