webForumDet fria alternativet

Hur lägger man till denna funktion...

ASP

7 svar · 226 visningar · startad av Rinaldo

Medlem sedan mars 20014 214 inlägg
Frågan#1
Function Shorter(strText)
	arrText = Split(strText, " ")
	
	For counter = 0 To uBound(arrText)
		If Len(arrText(counter)) > 50 then
			If newText <> "" then
				newText = newText & " " & Left(arrText(counter), 50) & " " & Right(arrText(counter), Len(arrText(counter))-50)
			Else
				newText = Left(arrText(counter), 50) & " " & Right(arrText(counter), Len(arrText(counter))-50)
			End If
		Else
			If newText <> "" then
				newText = newText & " " & arrText(counter)
			Else
				newText = arrText(counter)
			End If
		End If
	Next
	
	Shorter = newText
End Function

av spin till Emissions WF kod. vill få den i samma tag som som allt ligger i...

Medlem sedan feb. 20012 412 inlägg
#2

Hej!

Ursäkta, jag är allmänt trög det vet jag, men jag förstår inte frågan.

Vad vill du göra?

mvh Jörgen :)

------------------
Varför bråka när man kan kramas?

Medlem sedan mars 20014 214 inlägg
#3

Jag vill göra så att WF koden även förkortar ord som är längre än 50 tecken och då lägga till dem i : wfParser.Parse.

Medlem sedan mars 20014 214 inlägg
#4

någon?

------------------
zzzzzzzzzzzzzzzzzzzzzzzz...

Medlem sedan mars 20014 214 inlägg
#5

Är det verkligen inte någon som kan hjälpa mig med detta ?

------------------
zzzzzzzzzzzzzzzzzzzzzzzz...

Medlem sedan dec. 19996 721 inlägg
#6

Om du vill lägga in din funktion som en del av parsern så är det bara att lägga in den i parser-classen och lägga in ett anrop till den i slutet av Parse-metoden.

------------------
/emission
If you see someone without a smiley, give them your colon.

Medlem sedan mars 20014 214 inlägg
#7

I parser classen...?
såhär?

Function PareseLength(strText)
arrText = Split(strText, " ")

For counter = 0 To uBound(arrText)
If Len(arrText(counter)) > 50 then
If newText <> "" then
newText = newText & " " & Left(arrText(counter), 50) & " " & Right(arrText(counter), Len(arrText(counter))-50)
Else
newText = Left(arrText(counter), 50) & " " & Right(arrText(counter), Len(arrText(counter))-50)
End If
Else
If newText <> "" then
newText = newText & " " & arrText(counter)
Else
newText = arrText(counter)
End If
End If
Next

ParseLengt = newText
End Function

Hur och var ska jag anropa den?

------------------
zzzzzzzzzzzzzzzzzzzzzzzz...

Medlem sedan dec. 19996 721 inlägg
#8

Läs min kod, så hittar du både parser-classen (EMarkupParser) och dess Parse-metod.

258 ms totalt · 4 externa anrop · v20260731065814-full.a51de22e
126 ms — deklarationer (db)
0 ms — hämta statistik (cache)
130 ms — hämta tråd, inlägg och bilagor (db)
118 ms — ändringar (db)