Loop or Variable problem???

Discussion in 'ASP General' started by Tim::.., Apr 14, 2004.

  1. Tim::..

    Tim::.. Guest

    H

    Can someone please give me some advice with regards to this piece of ASP i have been trying to construct! It is giving me a bit of a head ache and I think it is because my loops or variables are messed up

    I want to use the last line of ASP "response.write(DateDiff("d", sDay(var,0), fdw(var,0)) )" to find the number of days between the start of the week and the Start date given in the XML file

    What am I doing wrong??

    I also guess there should be a more afficient way to produce the same results as I have here

    ...:: XM
    <Project><Tasks><Task><Start>2004-03-16T08:00:00</Start><Finish>2004-03-18T17:00:00</Finish></Task></Tasks></Project

    ...::AS
    Dim sNodes(200,100
    Dim sDate(200,100
    Dim sTime(200,100
    Dim sMonth(200,100
    Dim sDay(200,100
    Dim fdw(200,100
    'Dim fdnw(200,100
    'Dim fdwa(200,100

    node=-
    var=-

    set oNodes=xml.selectNodes("/Project/Tasks/Task/Start"

    for each oNode in oNode
    node=node+
    for i=0 to 9
    sNodes(node,i) = oNode.tex
    nex

    ' Write whole data and time for Start of task as seen in XML Documen
    'response.Write sNodes(node,0) & "<br>

    'Break up date into different variable
    var=var+
    for i=0 to 9
    sTemp = sNodes( node,0
    sDate( var,i ) = Mid( sTemp, 1, 10
    sTime( var,i ) = Mid( sTemp, 13, 4
    sMonth( var,i ) = Mid( sTemp, 6, 2
    sDay( var,i ) = Mid( sTemp, 9, 2
    next
    'response.write (sDate(var,0)) & "<br>
    'response.write (sTime(var,0)) & "<br>
    'response.write (sMonth(var,0)) & "<br>
    response.write "sDay " & (sDay(var,0)) & "<br>
    'End Break up dates into variable

    'Converts dates to beginning of week (Sunday
    'today = Date()
    ' or
    today = DateValue(sDate(var,0))
    var=var+
    for i=0 to 9
    firstday = today + 1 - weekday(today, 1
    fdw (var,i) = firstday
    'fdnw (var,i) = firstday+
    'fdwa (var,i) = firstday+1
    nex
    FirstDayWeek = fdw (var,0
    'response.Write(fdnw (var,0)) & "<BR>
    'response.Write(fdwa (var,0)) & "<BR>

    'fsDay = Mid( FirstDayWeek, 3, 2
    'response.Write(fsDay) & "<BR>
    'imgSpaceDay = sDay (var,0)- fsDa
    'response.write(imgSpaceDay
    response.write(DateDiff("d", sDay(var,0), fdw(var,0))
    next
     
    Tim::.., Apr 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGltOjouLg==?=

    Loop the loop...

    =?Utf-8?B?VGltOjouLg==?=, Feb 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,396
    Karl Seguin
    Feb 16, 2005
  2. Steven

    while loop in a while loop

    Steven, Mar 24, 2005, in forum: Java
    Replies:
    5
    Views:
    2,261
    Tim Slattery
    Mar 30, 2005
  3. mfglinux
    Replies:
    11
    Views:
    727
    Roberto Bonvallet
    Sep 12, 2007
  4. David Filmer
    Replies:
    19
    Views:
    260
    Kevin Collins
    May 21, 2004
  5. Isaac Won
    Replies:
    9
    Views:
    407
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page