March 28, 2024, 10:20:53 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


having trouble with dstrings

Started by John S, April 25, 2007, 12:35:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

John S

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;
}
John Siino, Advanced Engineering Services and Software

Ionic Wind Support Team

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.

Ionic Wind Support Team

John S

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.
John Siino, Advanced Engineering Services and Software

Parker

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.

Rock Ridge Farm (Larry)

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.