Removing "" from Array

Hello,

I would like to remove an array if the array element contains “”

How can i achive that. Please help

here is the code.

i=0

	While Not(docCurrentNew Is Nothing)

		Redim Preserve ArrayValue(i) 

		For j = 0 To Ubound(DocCurrentNew.AcctName)

			arrayValue(i) =doccurrentNew.AcctName(j)

			j=j+1

		Next

		i=i+1

Subject: Removing “” from Array

Use Fulltrim() :

vNewArray = Fulltrim(arrayValue)

The variable “vNewArray” will now be an array containing all items from arrayValue that is not empty.

hth

Subject: RE: Removing “” from Array

Hey Kenneth, thanks a lot…

it works now, well how can i make the array as null once i m using those values.

Thanks

Dev

Subject: RE: Removing “” from Array

vNewArray = Fulltrim(arrayValue)

use according to your requirement.

after your stuff make it null

vNewArray=“”

Cheers

RAJ

Subject: RE: Removing “” from Array

Hey ranjender

Yesterday you hv given me the code for the field if contains single value, but i have field that contains many values seperated with “,”

how can i make difference among them

Subject: RE: Removing “” from Array

use the Split function to create an array containing each of the values.

Subject: RE: Removing “” from Array

Hi thses seems to be very good!

could you please post bit of code

Subject: Domino Designer contains an example in the help for most functions

Help is pretty easy to use, in Domino Designer, click, Help, Help Topics, then click search and put in the name like split, you will get examples and documentation.

Sub Initialize
Dim ret As Variant
dim teststr as string
Dim delim As String

teststr = “This is the Connection”
delim = " "
ret = split(teststr, delim)

For x = 0 to 3
Print ret(x)
Next

End Sub

'OUTPUT
'This
'is
'the
'Connection

Subject: RE: Removing “” from Array

If it is a multivalue field then run a loop

if you use doc.field(0) then it returns single value first value.

for multi value field simple

dim tmp() as variant

i=0

redim preserve tmp(i)

for i = 0 to doc.fieldname ’ dont use (0)

tmp(i) = doc.fieldname(i)

i=i+1

next

let me know any questions

RAJ

Subject: RE: Removing “” from Array

i am not getting excately

could you please findout why!

For i= 0 To Ubound(docCurrentNew.AcctName)

arrayValue(i) =docCurrentNew.AcctName(i)

i=i+1

Next

Thanks

Dev

Subject: RE: Removing “” from Array

dim arrayvalue() as variant

i=0 'first intialize the i

For i= 0 To Ubound(docCurrentNew.AcctName)

redim arrayvalue(i) as variant

arrayValue(i) =docCurrentNew.AcctName(i)

i=i+1’incriment the i

next

then if you want to assign the arrayvalue to any field

doc.fieldname=arrayvalue

##dont use

doc.fieldname=arayvalue(i) or doc.fieldname=arayvalue(0)

why because we dont know the array limit thats the reason we are using dynamic array.