webForumDet fria alternativet

Capitalize Mismatch...

ASP

1 svar · 166 visningar · startad av Jesper T

Medlem sedan nov. 20017 144 inlägg
Frågan#1

Option Explicit

dim strText, textfield

'Gör små begynnelsebokstäver Stora
[b]Function Capitalize(strText)' Rad NIO[/b]
strText = UCase(Left(strText, 1)) & LCase(Mid(strText, 2))
For currChar = 1 To Len(strText)
If (Mid(strText, currChar, 1) = Chr(32)) OR (Mid(strText, currChar, 1) = "-") Then
newChar = UCase(Mid(strText, (currChar + 1), 1))
strText = Mid(strText, 1, currChar) & newChar & Mid(strText, currChar + 2)
End If
Next
Capitalize = strText

End Function

textfield = Capitalize(split(Request.Form("textfield"),","))

' Mera kod kommer här

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'strText'

/order/buffe_send.asp, line 9

MVH Jesper

Medlem sedan juni 200032 967 inlägg
#2

Du skickar in en array i funktionen, som förväntar sig en sträng.

Mvh,

374 ms totalt · 4 externa anrop · v20260731065814-full.e96017d9
250 ms — deklarationer (db)
0 ms — hämta statistik (cache)
120 ms — hämta tråd, inlägg och bilagor (db)
116 ms — ändringar (db)