January 27, 2021, 08:36:30 am


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


Started by srod, April 25, 2007, 02:57:36 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



just taking a good look at EMBasic and have a question (well 2 actually!  :)) regarding ISTRINGs.

If I define an ISTRING variable of say 3000 characters, then does the compiler allocate 3000 bytes of memory regardless, even if, say, I only ever place a single character within the underlying variable?

Question 2; how do you create an array of ISTRING variables?  Nearest I can figure is that I need to define a UDT containing an ISTRING field and then define an array of such types.  I must be missing something here!

Thanks in advance.


I believe the answer to your first question is yes.

Here's how I define and access arrays of IStrings:

define one-dimensional array - 100 IStrings of ten characters max length (including a null character)
Def SingleArray[10,100]:IString

When referencing elements from the array, always use 0 as the first parameter:

assign text to sixth string

define two-dimensional array - 25 indexes of 10 IStrings of eight characters max length (including a null character)
Def MultiArray[8,25,10]:IString

assign text to eighth string of thirteenth index
Software For Metalworking


Interesting.  The way you've defined an array of istrings there makes sense.