kind of stringlist 
Author Message
 kind of stringlist

Hi newsgroup,

I would like to use some sort of stringlist where I am always using the
first entry of this list to work with. The list doesn't have to be
displayed. It is just for processing one string after another. When done,
this (first) entry should be deleted and the second one should become first.

Does anyone have an idea how to solve this, eg what component I should be
using??

Thanks,

Pascal



Mon, 31 Jan 2005 17:34:39 GMT  
 kind of stringlist
Hi again.

I was wondering whether I could solve my problem with an array of strings.
Would it be possible to delete the first entry in such an array? How would
the source code look like to do so??

Thanks,

Pascal



Mon, 31 Jan 2005 21:41:05 GMT  
 kind of stringlist
Hi Pascal,

In eVB all variables are of type Variant,
so you would use a Variant array to hold your strings.

For example like this:

'--BEGIN SAMPLE CODE

vntStrings = Array("String1","String2","String3","String4")

'do your processing - arrays are 0-based in eVB
'e.g. ProcessString vntStrings(0)

'optional - you don't really need to do this  - delete the first string
vntStrings(0) = ""

For i = 0 to UBound(vntStrings) -1
    vntStrings(i) = vntStrings(i+1)
Next
'now make the array smaller by one
ReDim Preserve vntStrings(UBound(vntStrings)-1)

'now you have the new array with one less string

'-- END SAMPLE CODE

I think this is how you could achieve what you are looking for.
There may be some more code you need to write to deal with the
case when there is only one element left, but I think you get the idea.
What you do with that? I don't know but I hope it helped.

Michael


Quote:
> Hi again.

> I was wondering whether I could solve my problem with an array of strings.
> Would it be possible to delete the first entry in such an array? How would
> the source code look like to do so??

> Thanks,

> Pascal



Tue, 01 Feb 2005 07:44:11 GMT  
 kind of stringlist
There are many ways to do this.  If you know the maximum number that will be
in the list at any one time, use an array and pointers. Initialise the
pointers to the same array position, eg 0. As an item is received, copy it
to the array element at the end pointer and increment that pointer. If the
start pointer is less than the end pointer, process the array element at the
start pointer, and then increment that pointer.  All pointer incrementing is
modulo the array size. If the start pointer bumps into the end pointer, the
list is empty.  If the end pointer bumps into the start pointer the list has
overflowed.

The advantage of this approach is that you don't need a control and there is
minimum string copying.


Quote:
> Hi newsgroup,

> I would like to use some sort of stringlist where I am always using the
> first entry of this list to work with. The list doesn't have to be
> displayed. It is just for processing one string after another. When done,
> this (first) entry should be deleted and the second one should become
first.

> Does anyone have an idea how to solve this, eg what component I should be
> using??

> Thanks,

> Pascal



Tue, 01 Feb 2005 12:23:10 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Kind of Urgent please help: copy contacts from one folder to another without duplicate

2. Is there any kind of event that can be triggered on change of MAPI Folder

3. want to know what kind of view

4. Hide parameter kind

5. What kind of forum/newsgroup is this?

6. Some kind of addin to resize image

7. What Kind of Variable Did I receive?

8. Ping kind of application......

9. Text File manipulation - kind of urgent

10. Problem kind of urgent

11. a kind of CallByName

12. kind of callbyname again

 

 
Powered by phpBB® Forum Software