Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: magintz on Mon 11/10/2004 13:20:56

Title: FATAL ERROR
Post by: magintz on Mon 11/10/2004 13:20:56
---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0041421D ; program pointer is +6, ACI version 2.61.747, gtags (5,1)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

(Global script line 141)


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------

I'm tryig to create a chat window, I have got a string for the name of the person speaking called name, the text they have typed called input and two other variables called begin and end which will surround the name variable with <> so it should appear like this:

<Magintz>  Yo, Dudes

Here is the relavant code:

   {GetTextBoxText(PARSER,1,input); //This gathers the text from the text-box in GUI 0, and from Object1 and to store it in the predefined string "input"
StrCopy (end, ">  ");
StrCopy (begin, "<");
ListBoxAdd(4,0,begin && name && end && input);

I think the problem is with the && and how it can't add more than one variable, or it could be with the strcopy as I have never used that command before.
Title: Re: FATAL ERROR
Post by: Ashen on Mon 11/10/2004 13:44:43
Couldn't you simplify it a bit by using StrFormat? E.g.:

GetTextBoxText(PARSER,1,input);
StrFormat (end, "<%s> %s", name, input); // since the string 'end' is already declared
ListBoxAdd(4,0,end);


Is this any use, or have I missed the point?
Title: Re: FATAL ERROR
Post by: Gilbert on Tue 12/10/2004 02:23:40
Right, && is for logical comparisons (as in an if-clause), it's not used to join strings. For string operations most of the time you MUST use the Str...() functions (except in cases like Display() etc. where you can format directly within it).
Title: Re: FATAL ERROR
Post by: magintz on Tue 12/10/2004 19:44:38
Quote from: Ashen on Mon 11/10/2004 13:44:43
Couldn't you simplify it a bit by using StrFormat? E.g.:

GetTextBoxText(PARSER,1,input);
StrFormat (end, "<%s> %s", name, input); // since the string 'end' is already declared
ListBoxAdd(4,0,end);


Is this any use, or have I missed the point?


Thanks dude, worked a treat