I have a page, all items are hidden. The idea was to let the onformload
event trigger the page transformation.

Ive written teh following code that should case 1 letter to scroll
across the screen till it hits the leftedge of its area then another
character follows across and so and so on.

ive tested teh code in vb6 and it works great. yet on teh page all i get
is the company name appearing.

any ideas?

Option Explicit
dim Outpos
dim InPos
dim InString
dim InLen
dim wrkString
dim LastPos

sub Load_Main_Header_Line
inlen = 0
lastpos = 0
outpos = 0
Instring = "Company Name Here"
inlen = len(trim(instring))
wrkstring=space(inlen)
mainheader.style.visibility="visible"
mainheader.align="left"
mainheader.style.fontFamily ="impact"
mainheader.style.fontSize ="36pt"
mainheader.style.fontWeight ="bold"

lastpos = 1
outpos = inlen
inpos = 1
for inpos = 1 to inlen step 1
Get_A_Character
next

mainheader.innerText = trim(instring)
mainheader.align="center"

end sub

sub Get_A_Character
dim onechar
onechar = mid(instring, inpos, 1)
if onechar <> space(1) then
outpos = inlen
for outpos = inlen to lastpos step -1
Slide_It_Left
next
End if

lastpos = lastpos + 1
end sub

Sub Slide_It_Left
dim onechar
dim outString
dim tmpstring
dim oldpos
outstring = space(inlen)
onechar = mid(instring, inpos, 1)
tmpstring = wrkstring
'<-- space out last position
oldpos = outpos + 1
if outpos > 0 then
if oldpos <= inlen then
wrkstring = left(tmpstring,outpos) _
& onechar _
& space(inlen - (oldpos - 1))
else
wrkstring = left(tmpstring, (outpos - 1)) _
& onechar _
& space(inlen - (outpos - 1))
end if
mainheader.innerText = wrkstring
settimeout "WaitNull", 99999999
end if

end sub

sub WaitNull

end sub

I would really appreciate any ideas on this its driving me nuts.

sincerely

Woody
any sugestion or comment made by me should be examined first for
validity and appropriateness before assuming i have any idea at all
what the heck i am talking about. I am not responsible for anything you
may see with my name attached to it, i think.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Re: scrolling text by McKirahan

McKirahan
Mon Mar 01 13:56:57 CST 2004

"Woody" <lost@cyberspace.com> wrote in message
news:ueIqn$6$DHA.2484@TK2MSFTNGP12.phx.gbl...
> I have a page, all items are hidden. The idea was to let the onformload
> event trigger the page transformation.
>
> Ive written teh following code that should case 1 letter to scroll
> across the screen till it hits the leftedge of its area then another
> character follows across and so and so on.
>
> ive tested teh code in vb6 and it works great. yet on teh page all i get
> is the company name appearing.
>
> any ideas?
>
> Option Explicit
> dim Outpos
> dim InPos
> dim InString
> dim InLen
> dim wrkString
> dim LastPos
>
> sub Load_Main_Header_Line
> inlen = 0
> lastpos = 0
> outpos = 0
> Instring = "Company Name Here"
> inlen = len(trim(instring))
> wrkstring=space(inlen)
> mainheader.style.visibility="visible"
> mainheader.align="left"
> mainheader.style.fontFamily ="impact"
> mainheader.style.fontSize ="36pt"
> mainheader.style.fontWeight ="bold"
>
> lastpos = 1
> outpos = inlen
> inpos = 1
> for inpos = 1 to inlen step 1
> Get_A_Character
> next
>
> mainheader.innerText = trim(instring)
> mainheader.align="center"
>
> end sub
>
> sub Get_A_Character
> dim onechar
> onechar = mid(instring, inpos, 1)
> if onechar <> space(1) then
> outpos = inlen
> for outpos = inlen to lastpos step -1
> Slide_It_Left
> next
> End if
>
> lastpos = lastpos + 1
> end sub
>
> Sub Slide_It_Left
> dim onechar
> dim outString
> dim tmpstring
> dim oldpos
> outstring = space(inlen)
> onechar = mid(instring, inpos, 1)
> tmpstring = wrkstring
> '<-- space out last position
> oldpos = outpos + 1
> if outpos > 0 then
> if oldpos <= inlen then
> wrkstring = left(tmpstring,outpos) _
> & onechar _
> & space(inlen - (oldpos - 1))
> else
> wrkstring = left(tmpstring, (outpos - 1)) _
> & onechar _
> & space(inlen - (outpos - 1))
> end if
> mainheader.innerText = wrkstring
> settimeout "WaitNull", 99999999
> end if
>
> end sub
>
> sub WaitNull
>
> end sub
>
> I would really appreciate any ideas on this its driving me nuts.
>
> sincerely
>
> Woody

The setTimeOut" finction in VBScript is defined by DevGuru as:
http://www.devguru.com/Technologies/ecmascript/quickref/win_settimeout.html

METHOD: Window::setTimeout
----------------------------------------------------------------------------
----
window.setTimeout(expression/function, milliseconds)

This method is used to call a function or evaluate an expression after a
specified number of milliseconds. If an expression is to be evaluated, it
must be quoted to prevent it being evaluated immediately. Note that the use
of this method does not halt the execution of any remaining scripts until
the timeout has passed, it just schedules the expression or function for the
specified time.


Thus, your "WaitNull" subroutine does not wait.

I changed it to:

sub WaitNull
Dim i
For i = 0 To 99999
Next
end sub

and replaced
mainheader.innerText = wrkstring
after
window.status = wrkstring

and saw that your character-by-character line build worked.

I didn't get it to work the way you want though.



Re: scrolling text by McKirahan

McKirahan
Mon Mar 01 13:59:27 CST 2004

> Thus, your "WaitNull" subroutine does not wait.
>
> I changed it to:
>
> sub WaitNull
> Dim i
> For i = 0 To 99999
> Next
> end sub
>
> and replaced
> mainheader.innerText = wrkstring
> after
> window.status = wrkstring
>
> and saw that your character-by-character line build worked.
>
> I didn't get it to work the way you want though.



I forgot to mention that I commented out your
settimeout "WaitNull", 99999999
and inserted
WaitNull



Re: scrolling text by Erin

Erin
Mon Mar 01 15:10:31 CST 2004

Hi,
If what this script is trying to do is insert a bunch of spaces, you
should know you can't do that in HTML. Use &nbsp; instead


"Woody" <lost@cyberspace.com> wrote in message
news:ueIqn$6$DHA.2484@TK2MSFTNGP12.phx.gbl...
> I have a page, all items are hidden. The idea was to let the
onformload
> event trigger the page transformation.
>
> Ive written teh following code that should case 1 letter to scroll
> across the screen till it hits the leftedge of its area then another
> character follows across and so and so on.
>
> ive tested teh code in vb6 and it works great. yet on teh page all i
get
> is the company name appearing.
>
> any ideas?
>
> Option Explicit
> dim Outpos
> dim InPos
> dim InString
> dim InLen
> dim wrkString
> dim LastPos
>
> sub Load_Main_Header_Line
> inlen = 0
> lastpos = 0
> outpos = 0
> Instring = "Company Name Here"
> inlen = len(trim(instring))
> wrkstring=space(inlen)
> mainheader.style.visibility="visible"
> mainheader.align="left"
> mainheader.style.fontFamily ="impact"
> mainheader.style.fontSize ="36pt"
> mainheader.style.fontWeight ="bold"
>
> lastpos = 1
> outpos = inlen
> inpos = 1
> for inpos = 1 to inlen step 1
> Get_A_Character
> next
>
> mainheader.innerText = trim(instring)
> mainheader.align="center"
>
> end sub
>
> sub Get_A_Character
> dim onechar
> onechar = mid(instring, inpos, 1)
> if onechar <> space(1) then
> outpos = inlen
> for outpos = inlen to lastpos step -1
> Slide_It_Left
> next
> End if
>
> lastpos = lastpos + 1
> end sub
>
> Sub Slide_It_Left
> dim onechar
> dim outString
> dim tmpstring
> dim oldpos
> outstring = space(inlen)
> onechar = mid(instring, inpos, 1)
> tmpstring = wrkstring
> '<-- space out last position
> oldpos = outpos + 1
> if outpos > 0 then
> if oldpos <= inlen then
> wrkstring = left(tmpstring,outpos) _
> & onechar _
> & space(inlen - (oldpos - 1))
> else
> wrkstring = left(tmpstring, (outpos - 1)) _
> & onechar _
> & space(inlen - (outpos - 1))
> end if
> mainheader.innerText = wrkstring
> settimeout "WaitNull", 99999999
> end if
>
> end sub
>
> sub WaitNull
>
> end sub
>
> I would really appreciate any ideas on this its driving me nuts.
>
> sincerely
>
> Woody
> any sugestion or comment made by me should be examined first for
> validity and appropriateness before assuming i have any idea at all
> what the heck i am talking about. I am not responsible for anything
you
> may see with my name attached to it, i think.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!