C
c676228
Hi all,
I have a strange question which I cannot figure that out myself.
I tried to escape some apostrophe in the name string.
Function PrepCustomerDatatoArray(iTotNumCustomer)
dim CustInfoArr(50, 5)
....
for i=1 to iTotNumCustomer
If InStr(FName, "'") <> 0 Then
CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If
Response.Write CustInfoArr(i-1, 0) & "<br>" ' It displayed B''etty
If MInit<> "" Then
CustInfoArr(i-1, 1)=MInit
End If
If InStr(LName, "'") <> 0 Then
CustInfoArr(i-1, 2)=EscStrApostrophe(LName)
Else
CustInfoArr(i-1, 2)=LName
End If
Response.Write CustInfoArr(i-1, 2) & "<br>" ' It displayed O''neal if
customer enter O'neal as last name
CustInfoArr(i-1, 3)=BDate
Next
'but here it what strange thing happened
'the fname and lname in array with apostrophe will become empty here
'but it display MInit and BirthDate OK
'if fields don't have apostrophe, it will be displayed fine
'what is going on the array is in the scope since mInit and bDate are fine
and if
'no apostrophe, everything is fine?
For i=1 to iTotNumInsured
Response.Write CustInfoArr(i-1, 0) & " " & CustInfoArr(i-1, 1) & " " &
CustInfoArr(i-1, 2) & " " & CustInfoArr(i-1, 3)
Next
End Function
I have a strange question which I cannot figure that out myself.
I tried to escape some apostrophe in the name string.
Function PrepCustomerDatatoArray(iTotNumCustomer)
dim CustInfoArr(50, 5)
....
for i=1 to iTotNumCustomer
If InStr(FName, "'") <> 0 Then
CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If
Response.Write CustInfoArr(i-1, 0) & "<br>" ' It displayed B''etty
If MInit<> "" Then
CustInfoArr(i-1, 1)=MInit
End If
If InStr(LName, "'") <> 0 Then
CustInfoArr(i-1, 2)=EscStrApostrophe(LName)
Else
CustInfoArr(i-1, 2)=LName
End If
Response.Write CustInfoArr(i-1, 2) & "<br>" ' It displayed O''neal if
customer enter O'neal as last name
CustInfoArr(i-1, 3)=BDate
Next
'but here it what strange thing happened
'the fname and lname in array with apostrophe will become empty here
'but it display MInit and BirthDate OK
'if fields don't have apostrophe, it will be displayed fine
'what is going on the array is in the scope since mInit and bDate are fine
and if
'no apostrophe, everything is fine?
For i=1 to iTotNumInsured
Response.Write CustInfoArr(i-1, 0) & " " & CustInfoArr(i-1, 1) & " " &
CustInfoArr(i-1, 2) & " " & CustInfoArr(i-1, 3)
Next
End Function