Strings being left behind?

Started by monkey0506, Tue 19/07/2005 00:26:57

Previous topic - Next topic

monkey0506

I don't think that this belongs in the tech forums, so I'll ask it here.  Why haven't the strings been updated to a more OO style like everything else.  i.e., why do we still have to use global functions like "StrCopy(string str1, string str2)" instead of being able to do something like "str1.Copy(string str2)"?  I don't really know what brought it to mind, but I was playing around with it and made up a very simple SM (which just calls the global functions)(also, there was one function I couldn't program into the SM, StrFormat...I couldn't figure out any way of calling StrFormat with the "..." I used as a parameter to String.Format) so that I can do something to the effect of:

String mystr;
mystr.Copy("this is some text");

I'm not planning on using it.  But it got me wondering if there was a good reason why strings seem to be getting left behind in the upgrade race.  It would seem logical to do this IMO.  Just wondering...

strazer

The latest beta has experimental new string handling so you can do
  String mystr;
  mystr = "this is some text";
and also
  String str2 = mystr;
I think.

Or do you mean something else?

monkey0506

Not what I meant, but interesting.  I was talking about the way we still had to use global functions:

StrCaseComp
StrCat
StrCopy
StrComp
etc...

Instead of something like:

strname.CaseComp(otherstr)

It's nice about the new string usage though.  I've really been wanting that.  And I see that the new strings are "String"s not "string"s...Mental note taken.

So this isn't exactly what I was talking about, but it is a nice upgrade.

DoorKnobHandle

This is probably still like this because it is (even in the "oop"-languages like c++) still handled like this as well. It sounds better how you suggested it though.

Another question: Why is this thread here and not in the technical area? The description of the adventure-related talk and chat clearly says: "AGS-related but NOT technical"... :)

Gilbert

Quote from: monkey_05_06 on Tue 19/07/2005 01:31:57
Instead of something like:

strname.CaseComp(otherstr)
It's already heading that way in the newest beta, did you check ?
Currently, not all functions are converted to the new format, and I suppose they'll all be there when final's out.

monkey0506

Actually nevermind.  This is exactly what I meant...now that I downloaded it and am looking at it.  I LOVE THIS!

Edit:  Gilbot, I didn't understand that when reading over it.  I only gathered the new style of assigning and testing values.

SMF spam blocked by CleanTalk