Formating

this is my code i want to have a format number in sequencial numbers like this 000-000-01 up to so on.

Sub Postopen(Source As Notesuidocument)

Dim session As New NotesSession

Dim uidoc As notesuidocument

Dim w As New NotesUIWorkspace



Set uidoc = w.CurrentDocument

seqNo = session.GetEnvironmentValue("SeqNo")

If Isempty(seqNo) Then

	Call session.SetEnvironmentVar("SeqNo", 1)

Else

	seqNo = seqNo +1

	Call session.SetEnvironmentVar _

	("SeqNo", Cint(seqNo))

End If



Call uidoc.fieldsettext("epid", Cstr (session.GetEnvironmentValue("SeqNo")))

End Sub

any one who can help…

thanks…

Subject: formating

I would convert the number into a string with enough leading zeroes and then add the hyphens to the string.

I found that the standard Format$ function does not add the leading zeroes correctly, so I made this function:

Function MyFormat(i As Integer, ilen As Integer) As String

MyFormat = Right$(String$(ilen, "0") + Cstr(i), ilen)

End Function

Subject: RE: formating

there is no changes duting notes preview…please

help

Subject: RE: formating

Post your revised code which include Rob’s suggestion please

Subject: RE: formating

I can’t confirm that, at least not in 7.0.3.

outString = Format$(inNumber, “000-000-00”)

works just fine for me. However, an attempt to create sequential numbers using the environment technique is not really save (as all other attempts), and that should not go by unmentioned.

Subject: RE: formating

I have to admit: in 7.0.2 it also works fine. I guess that it was back in those 6.5 days, that I did not got it working.

Subject: RE: formating

Excellent point

I know that the comment about searching this forum for information on sequential numbering techniques has been mentioned numerous times during this ongoing saga!