delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/14/17:05:09

From: Forsberg Sakari <zacu AT cc DOT tut DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: C++ & Allegro & GUI
Date: 14 Oct 1999 16:05:57 GMT
Organization: Tampere University of Technology
Lines: 86
Message-ID: <7u4v15$5go$1@baker.cc.tut.fi>
NNTP-Posting-Host: lehtori.cc.tut.fi
Mime-Version: 1.0
X-Trace: baker.cc.tut.fi 939917157 5656 130.230.10.20 (14 Oct 1999 16:05:57 GMT)
NNTP-Posting-Date: 14 Oct 1999 16:05:57 GMT
User-Agent: tin/pre-1.4-981225 ("Volcane") (UNIX) (OSF1/V4.0 (alpha))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id MAB02237
Reply-To: djgpp AT delorie DOT com

Hi!  

I have following problem:

DJGPP says when I compile this that
"int main(): invalid types 'dialog[int]' for array subscript"

>>>>> in this line:   if ( kalenteri[5].x == 1 ) {;}
         
here is the program:

what have I forgotten?



//**************************************

#include <string>
...............
#include "allegro.h"

char *vuosi_list_getter( int index, int *list_size)
char *kuukausi_list_getter(int index, int *list_size)

//declare here all stuff that come into dialog....
..............

//and then declare dialog
dialog kalenteri(100);

//some functions, nothing special here...
int oma_pow10( int luku ) 
void int_to_str( int iMaara, char *temp2 )
void init_all()
	{
	// Setup Allegro and some internal stuff
	allegro_init(); //poistetaan autom
	vdrv_init(); //alustetaan ajurit, jotta
			//näkyy mun koneella
	install_keyboard(); //poistetaan autom
	install_mouse(); //poistetaan autom.
	install_timer(); //poistetaan autom.
	}
int init_screen()
void lopputekstit()
void lue_pvm( string szPvm[], char *saku, int iMax )
int dayofweek(int y, int m, int d)
int kuunpaivat(int vuosi, int kk, int skep)
int kktoint( string saku )
int toint( const string saku )
void piirra_kale(int iPaiva, int iKk, int iVuosi )
int find_color( PALETTE pal, RGB target )
int vaihda_paiva( void )
int main (void)
	{
	//alustetaan ohjelman tarvitsemat rutiinit *****************
	init_all();     //alustetaan allegro sun muut
	init screen();

	//add objects to dialog...
	kalenteri.add(KALE_REUNA,486,12,135,249);
	.....................
	kalenteri.add(KALE_NYKY_PVM,491,15,125,23);
	
	//palette + degui colours
	set_palette(desktop_palette);
	set_default_object_colors (235,236,237,238,239,240,241,242);

	//piirretään kalenteri tietyltä päivältä *******************
	KALE_KUU.selection(9); KALE_VUOSI.selection(19);
	vaihda_paiva();
	
	KALE_KUU.set_lostmouse_callback( vaihda_paiva );
	KALE_VUOSI.set_lostmouse_callback( vaihda_paiva );

	kalenteri.execute();

	if ( kalenteri[5].x == 1 ) {;}
	
	exit( EXIT_SUCCESS );
}


-- 
**      Sakari Forsberg zacu AT cc DOT tut DOT fi       **
** Information: finger zacu AT assari DOT cc DOT tut DOT fi **

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019