Re: Function Help Required

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"EA" <NOSPAM@xxxxxxxxxxxx> wrote in message
news:45129add$0$545$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ASP/VBScript - I do not recognise the syntax with the {s and }s, so I
cannot
see how it is VBScript.


VBScript is running on the server as part of the ASP page. It is building
output that will be sent to the client. The output in this case is JScript
code that will be executed by the client in the browser. It seems likely
that the syntax of the final JScript is faulty. However the problem will be
with the VBScript code that generated it. Like I said in another post use
view source to take a look.


If I am mixing my languages, then the previous code did also.

I have made a mistake in my question.... I should be using
ListOfPlayerCodes
which is a comma separated list, hence why I am using Split as before.
The
lsit does not contain spaves I have checked this out.

Response.write gave "178,11,12,82,83,131,136,10"

I am sure it is some form of syntax problem.


Agreed. Perhaps after using view source you could post the JScript if you
are unable to determine what the problem is.




"Anthony Jones" <Ant@xxxxxxxxxxxxxxxx> wrote in message
news:OA4K3HW3GHA.4588@xxxxxxxxxxxxxxxxxxxxxxx

"EA" <NOSPAM@xxxxxxxxxxxx> wrote in message
news:451253bb$0$533$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

function testScore() {
MyVar = <%
MyArr = Split(Replace(Request("Played")," ",""),",")
For x=0 to ubound(MyArr)
%>(Math.round(StatsForm.DB<%=MyArr(x)%>.value)) +<%
Next
%>0
if (MyVar != <%=Score%>) {
alert('Please check your doubles, they do not equal the team score
entered! ')
}else
{
StatsForm.action='MatchSave.asp'
StatsForm.submit()
}
}

The above code is from a working page. The difference in my example is
my
page is not recieving the player's codes via an Request (line 3) they
are
coming from an array I have built on the page.


Then your question is an ASP/VBScript question. If ArrayOfPlayerCodes is
actually an array then lose the split function around it.
Also the original code appears to be eliminating spaces have you ensured
that the ArrayOfPlayerCodes has had the spaces removed form it's
members.

Can you please explain what the difference, or where I am mixing
scripting
langauges where they were not be mixed before?





"Walter Zackery" <please_respond_to@xxxxxxxxx> wrote in message
news:%23AeWEKV3GHA.2152@xxxxxxxxxxxxxxxxxxxxxxx
You have vbscript and javascript intermingled together in a single
function - an unworkable combination.

"EA" <NOSPAM@xxxxxxxxxxxx> wrote in message
news:4511b765$0$2654$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function TestScore() {
MyVar = <%
MyArr = Split(ArrayOfPlayerCodes)
For x=0 to ubound(MyArr)
%>(Math.round(StatsForm.DB<%=MyArr(x)%>.value)) +<%
Next
%>0
if (MyVar != <%=Score%>) {
alert('Please check your doubles, they do not equal the team score
entered! ')
}else
{
StatsForm.action='Default.asp'
StatsForm.submit()
}
}

Can anyone tell me what my error is?











.



Relevant Pages

  • Re: ADODB.Stream....gone on client side????
    ... > Is there a way to use it on the client side with jscript or vbScript (internet explorer)? ...
    (microsoft.public.data.ado)
  • RE: Anchor / align
    ... If you want to move it at the client side, ... scripting using vbscript of jscript. ... you could make a server-side event and do the location changes ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Object Rexx to become Open Source
    ... Granted WSH is not a language. ... >> up quickly, then the knock against JScript would be that, because it is ... never said that JScript was bad or even not as good a language as VBScript; ... But our official standard scripting language for such things as logon ...
    (microsoft.public.scripting.wsh)
  • VBScript/JScript comparison
    ... differences between VBScript and JScript. ... reference types (objects, arrays, functions) are always passed by reference. ... Enumerator object's itemmethod. ...
    (microsoft.public.scripting.wsh)
  • Re: VBScript/JScript comparison
    ... > differences between VBScript and JScript. ... > Enumerator object's itemmethod. ... > primitive types are based on intrinsic objects that can be extended. ...
    (microsoft.public.scripting.wsh)