0
votes

In lotusscript. How do I add a variable to a field name? i.e I have

j=1
getitemvalue("Fieldname"+"j") 
j=j+1 
if j = n then j=1 and Loop 

So ideally if I put this in a for loop I want to populate fieldname1, fieldname2,...etc. What is the correct syntax for this?

1
getitemvalue("Fieldname"+Cstr(j))Per Henrik Lausten
doc.getitemvalue("Fieldname" & j)(0)D.Bugger
@D.Bugger: Yes right, thats the "lazy" way as &- operator does an implicit type conversion... Though I like the explicit method more...Torsten Link
Lazy, yep, that's me. :-) I hope you noticed the (0) too...D.Bugger

1 Answers

3
votes

You need to convert the value of the variable to a string using the cstr function and then append.

doc.getItemValue("field name" + cstr(j))