IonicWind Software

Aurora Compiler => General Discussion => Topic started by: John S on April 25, 2007, 12:35:26 PM

Title: having trouble with dstrings
Post by: John S on April 25, 2007, 12:35:26 PM
The following code crashes on me, but when I change FString to a string type from dstring it works.  I remember something somewhere that mentioned something about the null character at the end of a string (or dstring?).  Is that the trouble?

TabDlg::FormatProjInfo(dstring FString[1024] BYREF, string OutPutType), int
{
#ifdef DEBUG
OutputDebugStringA("FormatProjInfo");
#endif
   string INDENT = StrSpace(INDENTATION);
   FString =           INDENT + "Project Name:         " + m_proj_edit[1]->GetText() + "\n";
   FString = FString + INDENT + "Project Description:  " + m_proj_edit[0]->GetText() + "\n";
   FString = FString + INDENT + "Project Number:       " + m_proj_edit[2]->GetText() + "\n";
   FString = FString + INDENT + "Project Address:      " + m_proj_edit[3]->GetText() + "\n";
   FString = FString + INDENT + "Project Engineer:     " + m_proj_edit[4]->GetText() + "\n";
   FString = FString + INDENT + "Project Notes:        " + m_proj_edit[5]->GetText() + "\n";
   FString = FString + INDENT + "Project Date:         " + m_proj_edit[6]->GetText() + "\n\n";
return 8;
}
Title: Re: having trouble with dstrings
Post by: Ionic Wind Support Team on April 25, 2007, 07:03:53 PM
John,
DSTRING is a keyword, not a type, and should not be used in a parameter list.  It is only used to define a string of any length instead of the default 255 characters.  Which is the functional equivelant of the ISTRING Emergence basic keyword.

Your parameter list should just be the STRING type:

TabDlg::FormatProjInfo(string FString, string OutPutType), int

All strings are passed by reference and are null terminated, they don't include length information.

Paul.

Title: Re: having trouble with dstrings
Post by: John S on April 25, 2007, 09:57:19 PM
Thanks Paul,
I've been rewriting all of the output code to reflect using Parkers CString Class.  I have already blown quite a bit of time on that process.
Title: Re: having trouble with dstrings
Post by: Parker on April 26, 2007, 03:18:17 PM
I'm thinking about starting an Ionic Wind Developer's Toolkit during the summer which would include class libraries and tools helpful for Aurora and EBASIC programming (command line compiler utilities, a multi-language IDE, documentation generators, code formatters, etc).

My current CString and EB DynString are basically just skeleton string classes that I plan on expanding to something like Java's String when I create the toolkit, but it's good to hear that they are working well for you.
Title: Re: having trouble with dstrings
Post by: Rock Ridge Farm (Larry) on April 27, 2007, 06:06:55 AM
There was a toolkit early on that I bought - it seemed to go nowhere. There were 2 guys involved in that one..
There is also one from Bruce - also had the original of this - I know he has worked on it a lot.