|
 |
asp_databases thread: RE: SV: Re: Weird error..?
Message #1 by "Peter Foti (PeterF)" <PeterF@S...> on Fri, 17 May 2002 14:35:33 -0400
|
|
Does your function need to be defined before you attempt to call it
(like in some other languages)? Try moving your WordWrap function to
the beginning of your code. See if that makes any difference.
Pete
> -----Original Message-----
> From: SD-Studios [mailto:info@s...]
> Sent: Friday, May 17, 2002 2:12 PM
> To: ASP Databases
> Subject: [asp_databases] SV: Re: Weird error..?
>
>
> Here's the lines before:
>
> Dim strTextPreWrap
> Dim strTextPostWrap
> Dim intWrapPosition
>
> strTextPreWrap =3D rs("comment")
>
> intWrapPosition =3D CInt(0)
> If intWrapPosition =3D 0 Then intWrapPosition =3D 23
>
> strTextPostWrap =3D WordWrap(strTextPreWrap, intWrapPosition)
>
> Umm.. It has nothing to do with ASP and DB:s, but Im just
> desperate =3D)..
> Could you help me out anyway maybe?
> --
> MVH, Martin Johansson
> CEO & Project Supervisor
> SD-Studios
> +46 (0)70-3003320
> http://www.sd-studios.com
>
>
> -----Ursprungligt meddelande-----
> Fr=E5n: Ken Schaefer [mailto:ken@a...]
> Skickat: den 17 maj 2002 04:59
> Till: ASP Databases
> =C4mne: [asp_databases] Re: Weird error..?
>
>
> What is the line *before* this one? You don't have a line
continuation
> character at the end of the previous line do you?
>
> Also, what does this have to do with using ASP & Database? :-)
>
> Cheers
> Ken
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "SD-Studios" <info@s...>
> Subject: [asp_databases] Weird error..?
>
>
> : Hi!
> : I've been trying to use a wordwrapper to wrap some text.
> Problem is, Im
> : getting a weird error.. why?
> :
> : Here it is:
> : Microsoft VBScript compilation error '800a03ea'
> :
> : Syntax error
> :
> : /cdos/develop2/top.asp, line 123
> :
> : Function WordWrap(strTextToBeWrapped, intMaxLineLength)
> : ^
> :
> : This is the code:
> : Function WordWrap(strTextToBeWrapped, intMaxLineLength)
> : Dim strWrappedText
> :
> : Dim intLengthOfInput
> :
> : Dim intCurrentPosition
> : Dim intCurrentLineStart
> : Dim intPositionOfLastSpace
> :
> : intLengthOfInput =3D Len(strTextToBeWrapped)
> :
> : intCurrentPosition =3D 1
> : intCurrentLineStart =3D 1
> :
> : Do While intCurrentPosition < intLengthOfInput
> :
> : If intCurrentPosition =3D intCurrentLineStart +
> intMaxLineLength
> : Then
> :
> : strWrappedText =3D strWrappedText _
> : & Trim(Mid(strTextToBeWrapped,
> intcurrentLineStart)) _
> : & vbCrLf
> :
> : intCurrentLineStart =3D intCurrentPosition + 1
> :
> : Do While Mid(strTextToBeWrapped,
> intCurrentLineStart, 1) =3D
> "
> : "
> : intCurrentLineStart =3D intCurrentLineStart + 1
> : Loop
> : End If
> :
> : intCurrentPosition =3D intCurrentPosition + 1
> : Loop
> :
> : strWrappedText =3D strWrappedText &
> Trim(Mid(strTextToBeWrapped, _
> : intcurrentLineStart)) & vbCrLf
> :
> : WordWrap =3D strWrappedText
> : End Function
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
>
Message #2 by "SD-Studios" <info@s...> on Fri, 17 May 2002 20:12:19 +0200
|
|
Here's the lines before:
Dim strTextPreWrap
Dim strTextPostWrap
Dim intWrapPosition
strTextPreWrap = rs("comment")
intWrapPosition = CInt(0)
If intWrapPosition = 0 Then intWrapPosition = 23
strTextPostWrap = WordWrap(strTextPreWrap, intWrapPosition)
Umm.. It has nothing to do with ASP and DB:s, but Im just desperate =)..
Could you help me out anyway maybe?
--
MVH, Martin Johansson
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com
-----Ursprungligt meddelande-----
Från: Ken Schaefer [mailto:ken@a...]
Skickat: den 17 maj 2002 04:59
Till: ASP Databases
Ämne: [asp_databases] Re: Weird error..?
What is the line *before* this one? You don't have a line continuation
character at the end of the previous line do you?
Also, what does this have to do with using ASP & Database? :-)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "SD-Studios" <info@s...>
Subject: [asp_databases] Weird error..?
: Hi!
: I've been trying to use a wordwrapper to wrap some text. Problem is, Im
: getting a weird error.. why?
:
: Here it is:
: Microsoft VBScript compilation error '800a03ea'
:
: Syntax error
:
: /cdos/develop2/top.asp, line 123
:
: Function WordWrap(strTextToBeWrapped, intMaxLineLength)
: ^
:
: This is the code:
: Function WordWrap(strTextToBeWrapped, intMaxLineLength)
: Dim strWrappedText
:
: Dim intLengthOfInput
:
: Dim intCurrentPosition
: Dim intCurrentLineStart
: Dim intPositionOfLastSpace
:
: intLengthOfInput = Len(strTextToBeWrapped)
:
: intCurrentPosition = 1
: intCurrentLineStart = 1
:
: Do While intCurrentPosition < intLengthOfInput
:
: If intCurrentPosition = intCurrentLineStart + intMaxLineLength
: Then
:
: strWrappedText = strWrappedText _
: & Trim(Mid(strTextToBeWrapped, intcurrentLineStart)) _
: & vbCrLf
:
: intCurrentLineStart = intCurrentPosition + 1
:
: Do While Mid(strTextToBeWrapped, intCurrentLineStart, 1)
"
: "
: intCurrentLineStart = intCurrentLineStart + 1
: Loop
: End If
:
: intCurrentPosition = intCurrentPosition + 1
: Loop
:
: strWrappedText = strWrappedText & Trim(Mid(strTextToBeWrapped, _
: intcurrentLineStart)) & vbCrLf
:
: WordWrap = strWrappedText
: End Function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by "Ken Schaefer" <ken@a...> on Tue, 21 May 2002 16:56:16 +1000
|
|
So your code looks like:
<%
'
strTextPostWrap = WordWrap(strTextPreWrap, intWrapPosition)
Function WordWrap(strTextToBeWrapped, intMaxLineLength)
' Stuff here
End Function
%>
?
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "SD-Studios" <info@s...>
Subject: [asp_databases] SV: Re: Weird error..?
: Here's the lines before:
:
: Dim strTextPreWrap
: Dim strTextPostWrap
: Dim intWrapPosition
:
: strTextPreWrap = rs("comment")
:
: intWrapPosition = CInt(0)
: If intWrapPosition = 0 Then intWrapPosition = 23
:
: strTextPostWrap = WordWrap(strTextPreWrap, intWrapPosition)
:
: Umm.. It has nothing to do with ASP and DB:s, but Im just desperate =)..
: Could you help me out anyway maybe?
: --
: MVH, Martin Johansson
: CEO & Project Supervisor
: SD-Studios
: +46 (0)70-3003320
: http://www.sd-studios.com
:
:
: -----Ursprungligt meddelande-----
: Från: Ken Schaefer [mailto:ken@a...]
: Skickat: den 17 maj 2002 04:59
: Till: ASP Databases
: Ämne: [asp_databases] Re: Weird error..?
:
:
: What is the line *before* this one? You don't have a line continuation
: character at the end of the previous line do you?
:
: Also, what does this have to do with using ASP & Database? :-)
:
: Cheers
: Ken
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: "SD-Studios" <info@s...>
: Subject: [asp_databases] Weird error..?
:
:
: : Hi!
: : I've been trying to use a wordwrapper to wrap some text. Problem is, Im
: : getting a weird error.. why?
: :
: : Here it is:
: : Microsoft VBScript compilation error '800a03ea'
: :
: : Syntax error
: :
: : /cdos/develop2/top.asp, line 123
: :
: : Function WordWrap(strTextToBeWrapped, intMaxLineLength)
: : ^
: :
: : This is the code:
: : Function WordWrap(strTextToBeWrapped, intMaxLineLength)
: : Dim strWrappedText
: :
: : Dim intLengthOfInput
: :
: : Dim intCurrentPosition
: : Dim intCurrentLineStart
: : Dim intPositionOfLastSpace
: :
: : intLengthOfInput = Len(strTextToBeWrapped)
: :
: : intCurrentPosition = 1
: : intCurrentLineStart = 1
: :
: : Do While intCurrentPosition < intLengthOfInput
: :
: : If intCurrentPosition = intCurrentLineStart + intMaxLineLength
: : Then
: :
: : strWrappedText = strWrappedText _
: : & Trim(Mid(strTextToBeWrapped, intcurrentLineStart))
_
: : & vbCrLf
: :
: : intCurrentLineStart = intCurrentPosition + 1
: :
: : Do While Mid(strTextToBeWrapped, intCurrentLineStart, 1)
: "
: : "
: : intCurrentLineStart = intCurrentLineStart + 1
: : Loop
: : End If
: :
: : intCurrentPosition = intCurrentPosition + 1
: : Loop
: :
: : strWrappedText = strWrappedText & Trim(Mid(strTextToBeWrapped, _
: : intcurrentLineStart)) & vbCrLf
: :
: : WordWrap = strWrappedText
: : End Function
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:
:
:
:
|
|
 |