Tuesday, October 7, 2008

Persistant Scripting Variables

Here's another one that baffled me this morning.

I need to break an OHIP number into number and version.

I get it like this 123456789-VS1 I needed the numbers in one field and the letters (the version) in another.

Easy enough eh?

So I wrote the one Scripting Functoid

Public Function HC_Number(ByVal strHCN as String) As String
Dim strReturn() As String

strReturn = Microsoft.VisualBasic.Split(strHCN, "-")
HC_Number = strReturn(0)
End Function


Like I said...easy

So I copied that over to the functoid to pull the version and changed the (0) to a (1).

I tested the map and was stunned to see that same value in both fields.

I even called Gord into my office to see if maybe for some reason I was seeing two separate lines going into two separate fields but no one else could.

Everything looked fine to him. He asks to see my code...and points out the obvious.

I needed to change HC_Number to HC_Version in the second functoid. (why do I keep wanting to call them scriptoids?)

Anyway, as you can see, I'm a bit of a noob.

No comments: