May 01, 2024, 10:33:30 AM

News:

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


problem with OPENFILE ??

Started by ExMember001, November 15, 2006, 12:22:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ionic Wind Support Team

WSTRING is the Aurora unicode string.  DWSTRING is the dimensionable unicode string.  As mentioned in the tutorial included with the help. 

Quote
A string value in Windows ironiaclly is 2 gig in size not 255 characters.

Were did you get that idea?.  Windows doesn't have a string type, or any types at all for that matter.  The API uses NULL terminated strings the same as the C runtime.  COM uses a system string which is allocated dynamically, like we do with NEW.

I mention the C runtime because technically C and C++ don't have a string type at all.  In C++ a string type is provided by a class, or template, not by the compiler.  In C a string is a character array and all of the string capabilities are contained in a library. 

Quote
What I did not know for sure until now, is that Aurora had a fixed length for a string, now I know.

No it just has the convenience of allocating a 255 byte one when you use STRING name or a 255 character one when using WSTRING name.  A DSTRING is a keyword meaning "dimension a string".

dstring name[30000]; // a 30K string

Of course if you're really into dynamic string you can use NEW.

string *name = new(byte, 1000000); // A million byte string.

Lots of choices built in.

Paul.
Ionic Wind Support Team

J B Wood (Zumwalt)

As I mentioned, in .Net, its a collection of unicode characters:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemstringclasstopic.asp
Thats where I got that idea.
The maximum size of the string object is or was 2 gig.
When you create a string object, and don't give it an intial value, you are in essance creating a 2 byte empty object. (null)
When you add a value to that object, it creates a new object replacing the original object and its size is equal to the number of unicode characters you add.
The maximum size I had read a long time ago for the 2 gig max length for the string (2 gig of unicode characters), although I could be sadly mistaken.

Ionic Wind Support Team

Thats .NET not Windows.  Windows itself is just an OS and doesn't have types.  .NET is a runtime used by Microsoft (and a few other) languages.  My point was the string class in .NET is provided by the runtime, not by the language which uses it.  And the class isn't really a type either, it is a dynamic object.

You could create your own string class in Aurora if you want.  There is an example of a dynamic array class included with Aurora, oop1.src, which can be modified to support any data type.  Just remember memory allocations and deletions add overhead to your program.  If you're looking for speed and you're doing a ton of text processing then you want to stay away from excessive memory allocations.

That is the one thing that irks me about bloated runtimes, sure they add a ton of convenience but they make for poor programmers.  Especially if the programmer has never had to do it for themselves before.  You go through school and all they teach is C# and Java.  Then you're employed by a company that doesn't want you to use .NET because their product has to be cross platform, and quickly. If you don't know the basics of data types, type sizes, and data algorythms you are screwed. 

The Aurora compiler has built in types that are not based on a runtime but directly generated in assembly code.  The compiler natively knows what a string is and can concatenate two strings without having to use a class.  It does this for both speed and size.

Paul.
Ionic Wind Support Team