Can I programmatically DIM?

instead of dim’ing out 75 item and string variables to fill, i thought i could loop through the currently selected document, get all fieldnames, and from those field names, echo back and create a “Dim fieldName as string”

I not sure if this can be done… can it?

Because if it can, then I can easily populate the fieldname variable…

While Not (doc Is Nothing)

If doc.Hasitem("BidNumber")Then

	

' here I get all field names on the document and exclude the few that i do not want

	j=0

	ForAll x In doc.Items

		ReDim Preserve fieldNames (j)

		checkFieldName = x.Name

		If NOT(IsElement(exemptFields(checkFieldName))) Then

			fieldNames(j) = x.Name

			j=j+1

		End If

	End ForAll



	

' now declare our field names as strings..

	j=0

	ForAll y In fieldNames()

	'??? ''' brain is frying here...



		j=j+1

	End ForAll



End If

i = i + 1

Set doc = view.Getnextdocument(doc)

Wend 1

Subject: Why use individual strings?

Isn’t this a text book situation where you would use an array, or even better a list of all the field values?

Dim field List As String

ForAll item In doc.Items

If Not(IsElement(exemptFields(i.Name))) Then

field(i.Name) = i.Text

End If

End ForAll

Now you have a list of all your fields, and their values as string, and you can easily use them later in your code.

Subject: that works

that works…

it’s a better way…

now I just gotta to the sql stuff with it…

thanks…