From: John G <al...@pa...> - 2000-02-27 23:03:48
|
As it is, that program will do nothing. Changing it to: #include <stdio.h> #define USE_CONSOLE #include <allegro.h> int main() { allegro_init(); printf("hello world\n"); return 0; } END_OF_MAIN() and "hello world" is printed to the console as wanted. I believe that is the same for all versions. END_OF_MAIN() macro of allegro, in effect changes main() to WinMain(), so you need to define the allegro constant USE_CONSOLE to tell it not to do that, so the compiler interpets the program as a console app. Hope this helps -John <SNIP> >From <all...@ca...> Sun Feb 27 15:37:41 2000 Received: from juliet.stfx.ca [141.109.2.2] by canvaslink.com with ESMTP (SMTPD32-6.00) id AB133FC9002C; Sun, 27 Feb 2000 15:37:39 -0500 Received: from stfx.ca (stfx-remote-47.stfx.ca [141.109.223.133]) by juliet.stfx.ca (8.8.8/8.8.8) with ESMTP id QAA87634 for <al...@ca...>; Sun, 27 Feb 2000 16:35:58 -0400 Message-ID: <38B...@st...> Date: Sun, 27 Feb 2000 16:26:15 -0400 From: Mark Yorke <x9...@ju...> X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: al...@ca... References: <38B...@st...> <38B...@bi...> <38B...@st...> <38B...@st...> <38B...@st...> <38B...@st...> <38B...@bi...> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [AL] SeeR: scripts/structs Precedence: bulk Sender: all...@ca... Reply-To: al...@ca... X-UIDL: 251776013 Status: O Content-Length: 1667 Lines: 35 > > > I realize how the cow and dog sample was set up, but why doesn't this file work? > > > it should print the number 128, but it prints a 0. why? how do I add to the cow > > > and dog sample so that I can call values as well as functions from a script? i > > > would also like to be able to add to the scripted main: > > > > > > printf("s.num in main:%d\n", s.num); > > > > > > but i get a sigsev crash. what should i be doing instead? > > > > how about an easier question. in the cow and dog sample, how do i gain access to the > > > > char *name = "..."; > > > > in the scripts? suppose I wanted to say cow[1].name; how would i do this? > > I can't honestly say. I've not seen the Cow and Dog example before, and > I > can't quite see it. It comes with the latest release of SeeR. I downloaded it last night and started looking at the examples provided with it. I wanted to be able to access a script's variables inside it. In the cow and dog example, there are three SC files: one for a dog, one for a cow, and one for main. All that I want to do is access values within instantiated scripts. If a cow was instantiated, I would like to get the char *name variable that's in its script. If you wanted me to attach the 3 script files and the c file so you can compile and look at them, I have no problem with that. It seems to me that what I want to do isn't as hard as it seems. > I gather you're using a C++ approach? I can't really help there. > All my stuff is plain C, at least where SeeR is concerned. Well, sort of. I wanted to get ahold of scripts' variables as well as functions. I just can't seem to get it right. Thanks for your help! SteelGolem |