Ask a Question related to ASP, Design and Development.

  1. #1

    Default script problem

    I am trying to write to a file using:

    <%

    Sub OpenTextFileTest

    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    Dim fso, f

    Set fso = CreateObject("Scripting.FileSystemObject")

    Set f = fso.OpenTextFile("c:\inetpub\rako\commands.txt", ForAppending, True)

    f.Write "Hello world!"

    f.Close

    End Sub

    %>



    When i call this the script hangs. If I try page refresh, I get "The
    requested resource is in use". I have to kill the dllhost.exe process to
    free things up.

    Any ideas why this won't work?


    Freeserve Guest

  2. Similar Questions and Discussions

    1. PHP script problem?
      Hi All, I did a couple of pages in php and a server side script for a previous client.... However I have managed to lose all my work down to a...
    2. FileXtra3 Script Problem
      Using FileXtra 3, I want to create a button that finds the CD Rom Drive and copies files off the CD and onto the end-users hard drive. I'm using the...
    3. Script Problem?
      In reply to KG25b.60017$0u4.22349@news1.central.cox.net on 9/2/03 8:28 AM by markris@markris.com markris@markris.com: In the words of Henry Lee,...
    4. script problem with quicktime...
      hey ho! here's the problem: i've got a quicktime movie which i want to play till its end and then jump to another frame. i know there a hundreds...
    5. Another Script problem
      I get permission not held when running as Administrator, it should log user off Sub ShutDown() Dim Connection, WQL, SystemClass, System Set...
  3. #2

    Default Re: script problem

    Sounds like classic script blocking problem, I am guessing you have norton
    antivirus on your machine? Go into NAV and locate script
    blocking.....disable it and then things should start working.

    Something to do with script block and the FSO.

    Good luck

    Stu

    "Freeserve" <nospam@bigfoot.com> wrote in message
    news:blji7u$qou$1@news6.svr.pol.co.uk...
    > I am trying to write to a file using:
    >
    > <%
    >
    > Sub OpenTextFileTest
    >
    > Const ForReading = 1, ForWriting = 2, ForAppending = 8
    >
    > Dim fso, f
    >
    > Set fso = CreateObject("Scripting.FileSystemObject")
    >
    > Set f = fso.OpenTextFile("c:\inetpub\rako\commands.txt", ForAppending,
    True)
    >
    > f.Write "Hello world!"
    >
    > f.Close
    >
    > End Sub
    >
    > %>
    >
    >
    >
    > When i call this the script hangs. If I try page refresh, I get "The
    > requested resource is in use". I have to kill the dllhost.exe process to
    > free things up.
    >
    > Any ideas why this won't work?
    >
    >

    Stuart Palmer Guest

  4. #3

    Default Re: script problem

    Yes. That fixed it. Thanks.

    "Stuart Palmer" <tryandspamme@youcant.com> wrote in message
    news:bljl6f$1e6k$1@sp15at20.hursley.ibm.com...
    > Sounds like classic script blocking problem, I am guessing you have norton
    > antivirus on your machine? Go into NAV and locate script
    > blocking.....disable it and then things should start working.
    >
    > Something to do with script block and the FSO.
    >
    > Good luck
    >
    > Stu
    >
    > "Freeserve" <nospam@bigfoot.com> wrote in message
    > news:blji7u$qou$1@news6.svr.pol.co.uk...
    > > I am trying to write to a file using:
    > >
    > > <%
    > >
    > > Sub OpenTextFileTest
    > >
    > > Const ForReading = 1, ForWriting = 2, ForAppending = 8
    > >
    > > Dim fso, f
    > >
    > > Set fso = CreateObject("Scripting.FileSystemObject")
    > >
    > > Set f = fso.OpenTextFile("c:\inetpub\rako\commands.txt", ForAppending,
    > True)
    > >
    > > f.Write "Hello world!"
    > >
    > > f.Close
    > >
    > > End Sub
    > >
    > > %>
    > >
    > >
    > >
    > > When i call this the script hangs. If I try page refresh, I get "The
    > > requested resource is in use". I have to kill the dllhost.exe process
    to
    > > free things up.
    > >
    > > Any ideas why this won't work?
    > >
    > >
    >
    >

    Freeserve Guest

  5. #4

    Default script problem

    Hi everyone,

    I am created this script to send e-mails (see below).
    I get this error when I try to run it:

    Number found where operator expected at
    C:\scriptz\test\NEWSCR~1.CGI line 15, ne
    ar "The IP address for the interface that caused the
    event, or "0"
    (Might be a runaway multi-line "" string starting on
    line 7)
    (Do you need to predeclare The?)
    String found where operator expected at
    C:\scriptz\test\NEWSCR~1.CGI line 16, ne
    ar "The NNM management station ID: $ARGV[9] ""
    (Might be a runaway multi-line "" string starting on
    line 15)
    (Missing semicolon on previous line?)
    syntax error at C:\scriptz\test\NEWSCR~1.CGI line 15,
    near "The IP address for t
    he interface that caused the event, or "0"
    BEGIN not safe after errors--compilation aborted at
    C:\scriptz\test\NEWSCR~1.CGI
    line 20.

    This is the script. I think it has something to do
    with the "'s but I am not sure where I am going wrong.
    Any help would be great.

    Thx,

    Leon


    #!/usr/local/bin/perl
    #Send E-mail for Critical Alerts

    #Here we define our parameters
    $to = 'me@me.com';
    $from = "Openview Server";
    $body = "Interface Down: The ID of application
    sending the event is $ARGV[0]
    The hostname of the node that caused the event is:
    $ARGV[1]
    The HP OpenView object identifier of the node that
    caused the event is: $ARGV[2]
    The HP OpenView object identifier of the node that
    caused the event is: $ARGV[3]
    The database name is: $ARGV[4]
    A time stamp for when the event occurred is: $ARGV[5]
    The HP OpenView object identifier of the interface
    that caused the event is: $ARGV[6]
    The name or label for the interface that caused the
    event is: $ARGV[7]
    The IP address for the interface that caused the
    event, or "0" if unavailable is: $ARGV[8]
    The NNM management station ID: $ARGV[9] ";
    $subject = "Major Failure segment $ARGV[0] is down";

    #Here we use the module pass more specific parameters
    use Net::SMTP;

    $smtp = Net::SMTP->new('10.11.1.134');

    $smtp->mail($ENV{USER});
    $smtp->to($to);

    $smtp->data();
    $smtp->datasend("Importance: High\n");
    $smtp->datasend("From: $from\n");
    $smtp->datasend("To: $to\n");
    $smtp->datasend("Subject: $subject\n");
    $smtp->datasend("\n");
    $smtp->datasend("$body");
    $smtp->dataend();

    $smtp->quit;


    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free web site building tool. Try it!
    [url]http://webhosting.yahoo.com/ps/sb/[/url]
    Leon Guest

  6. #5

    Default RE: script problem

    > Hi everyone,
    Howdy.
    >
    > I am created this script to send e-mails (see below).
    > I get this error when I try to run it:
    >
    use strict;
    use warnings;
    > Number found where operator expected at
    > C:\scriptz\test\NEWSCR~1.CGI line 15, ne ar "The IP address
    > for the interface that caused the event, or "0"
    > (Might be a runaway multi-line "" string starting on
    > line 7)
    > (Do you need to predeclare The?)
    > String found where operator expected at
    > C:\scriptz\test\NEWSCR~1.CGI line 16, ne ar "The NNM
    > management station ID: $ARGV[9] ""
    > (Might be a runaway multi-line "" string starting on
    > line 15)
    > (Missing semicolon on previous line?)
    > syntax error at C:\scriptz\test\NEWSCR~1.CGI line 15,
    > near "The IP address for t
    > he interface that caused the event, or "0"
    > BEGIN not safe after errors--compilation aborted at
    > C:\scriptz\test\NEWSCR~1.CGI line 20.
    >
    > This is the script. I think it has something to do
    > with the "'s but I am not sure where I am going wrong.
    > Any help would be great.
    Most likely, yes you need to escape quotes that are within quotes.
    So "
    Becomes \"
    You could also use qq() or a HERE doc:

    my $var = <<TEXT;
    Blah
    Blah bla "" blah
    TEXT

    HTH

    DMuey
    >
    > Thx,
    >
    > Leon
    >
    >
    > #!/usr/local/bin/perl
    > #Send E-mail for Critical Alerts
    >
    > #Here we define our parameters
    > $to = 'me@me.com';
    > $from = "Openview Server";
    > $body = "Interface Down: The ID of application
    > sending the event is $ARGV[0]
    > The hostname of the node that caused the event is:
    > $ARGV[1]
    > The HP OpenView object identifier of the node that
    > caused the event is: $ARGV[2]
    > The HP OpenView object identifier of the node that
    > caused the event is: $ARGV[3]
    > The database name is: $ARGV[4]
    > A time stamp for when the event occurred is: $ARGV[5]
    > The HP OpenView object identifier of the interface
    > that caused the event is: $ARGV[6]
    > The name or label for the interface that caused the
    > event is: $ARGV[7]
    > The IP address for the interface that caused the
    > event, or "0" if unavailable is: $ARGV[8]
    > The NNM management station ID: $ARGV[9] ";
    > $subject = "Major Failure segment $ARGV[0] is down";
    >
    > #Here we use the module pass more specific parameters
    > use Net::SMTP;
    >
    > $smtp = Net::SMTP->new('10.11.1.134');
    >
    > $smtp->mail($ENV{USER});
    > $smtp->to($to);
    >
    > $smtp->data();
    > $smtp->datasend("Importance: High\n");
    > $smtp->datasend("From: $from\n");
    > $smtp->datasend("To: $to\n");
    > $smtp->datasend("Subject: $subject\n");
    > $smtp->datasend("\n");
    > $smtp->datasend("$body");
    > $smtp->dataend();
    >
    > $smtp->quit;
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > Yahoo! SiteBuilder - Free web site building tool. Try it!
    [url]http://webhosting.yahoo.com/ps/sb/[/url]

    --
    To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    For additional commands, e-mail: [email]beginners-help@perl.org[/email] <http://learn.perl.org/> <http://learn.perl.org/first-response>


    Dan Muey Guest

  7. #6

    Default Re: script problem

    Leon wrote:
    > Hi everyone,
    >
    > I am created this script to send e-mails (see below).
    > I get this error when I try to run it:
    >
    > Number found where operator expected at
    > C:\scriptz\test\NEWSCR~1.CGI line 15, ne
    > ar "The IP address for the interface that caused the
    > event, or "0"
    > (Might be a runaway multi-line "" string starting on
    > line 7)
    > (Do you need to predeclare The?)
    > String found where operator expected at
    > C:\scriptz\test\NEWSCR~1.CGI line 16, ne
    > ar "The NNM management station ID: $ARGV[9] ""
    > (Might be a runaway multi-line "" string starting on
    > line 15)
    > (Missing semicolon on previous line?)
    > syntax error at C:\scriptz\test\NEWSCR~1.CGI line 15,
    > near "The IP address for t
    > he interface that caused the event, or "0"
    > BEGIN not safe after errors--compilation aborted at
    > C:\scriptz\test\NEWSCR~1.CGI
    > line 20.
    >
    > This is the script. I think it has something to do
    > with the "'s but I am not sure where I am going wrong.
    > Any help would be great.
    >
    > Thx,
    >
    > Leon
    >
    >
    > #!/usr/local/bin/perl
    > #Send E-mail for Critical Alerts
    >
    > #Here we define our parameters
    > $to = 'me@me.com';
    > $from = "Openview Server";
    > $body = "Interface Down: The ID of application
    > sending the event is $ARGV[0]
    > The hostname of the node that caused the event is:
    > $ARGV[1]
    > The HP OpenView object identifier of the node that
    > caused the event is: $ARGV[2]
    > The HP OpenView object identifier of the node that
    > caused the event is: $ARGV[3]
    > The database name is: $ARGV[4]
    > A time stamp for when the event occurred is: $ARGV[5]
    > The HP OpenView object identifier of the interface
    > that caused the event is: $ARGV[6]
    > The name or label for the interface that caused the
    > event is: $ARGV[7]
    > The IP address for the interface that caused the
    > event, or "0" if unavailable is: $ARGV[8]
    > The NNM management station ID: $ARGV[9] ";
    > $subject = "Major Failure segment $ARGV[0] is down";
    >
    > #Here we use the module pass more specific parameters
    > use Net::SMTP;
    >
    > $smtp = Net::SMTP->new('10.11.1.134');
    >
    > $smtp->mail($ENV{USER});
    > $smtp->to($to);
    >
    > $smtp->data();
    > $smtp->datasend("Importance: High\n");
    > $smtp->datasend("From: $from\n");
    > $smtp->datasend("To: $to\n");
    > $smtp->datasend("Subject: $subject\n");
    > $smtp->datasend("\n");
    > $smtp->datasend("$body");
    > $smtp->dataend();
    >
    > $smtp->quit;
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > Yahoo! SiteBuilder - Free web site building tool. Try it!
    > [url]http://webhosting.yahoo.com/ps/sb/[/url]
    you have to \" in strings.
    Eternius Guest

  8. #7

    Default RE: script problem

    > event, or "0" if unavailable is: $ARGV[8]
    Escape the \"0\"

    Paul Kraus Guest

  9. #8

    Default Re: script problem

    Eternius wrote:
    > Leon wrote:
    > > Hi everyone,
    > > # another 50 or so lines of original post
    > > $smtp->quit;
    # snugged up tightly to the bottom of boilerplate:
    > > __________________________________
    > > Do you Yahoo!?
    > > Yahoo! SiteBuilder - Free web site building tool. Try it!
    > > [url]http://webhosting.yahoo.com/ps/sb/[/url]
    > you have to \" in strings.
    Please trim original text and provide some visible indication of
    where your responses begin. That was useful and correct feedback,
    but almost lost in context.

    Joseph


    R. Joseph Newton Guest

  10. #9

    Default script problem

    hi
    Snapping problem again. i want to snap 5 models to different dummy models
    (which has #visibility = none). when i work with one model and one dummy model
    the snapping works very fine but with multiple objects -- the models snap all
    together (on mouseDown). i think the problem will get solved if i can disable
    the model drag on the other models or on clicking one model the other models
    should be disabled but i dont know how to write this plz can some one help me?
    This is the script:

    The models names are ---- sphere01, sphere02, sphere03, sphere04, sphere05
    SphereDummy01, SphereDummy02, SphereDummy03, SphereDummy04, SphereDummy05


    --*********************************************--
    property pSprite
    property pMember
    --------------------------------------
    property pPosition1
    property pPosition2
    property pPosition3
    property pPosition4
    property pPosition5
    property pPositionDum1
    property pPositionDum2
    property pPositionDum3
    property pPositionDum4
    property pPositionDum5
    ----------------------------------------------
    property pDrag
    --************************************************--
    on beginSprite me
    pSprite = sprite(me.spritenum)
    pMember = pSprite.member
    pPosition1 = pMember.model("sphere01").transform.position
    pDrag =false
    end beginsprite

    on enterFrame me
    if pDrag then
    theNewPos=pMember.camera.spritespacetoworldspace (the mouse loc)
    --the following depends of your world axis
    -- for example if the camera is pointing from top to bottom
    theNewPos=vector (theNewPos.x, theNewPos.y, theNewPos.z)
    pMember.model("sphere01").transform.position=theNe wPos
    end if

    pPosition = pMember.model("sphere01").transform.position
    tposition = pMember.model("SphereDummy01").transform.position
    distance=(pPosition-tposition).magnitude
    if distance <20 then -- for example
    pMember.model("sphere01").transform.position=tPosi tion
    pPosition=tPosition
    end if
    end enterFrame

    on mouseDown me
    pDrag=true
    end mouseDown

    on mouseUp me
    pDrag=false
    end mouseUp
    --************************************************** ***********--

    thanking you in advance.

    william


    WILLIE8768 Guest

  11. #10

    Default Re: script problem

    you could simply store the reference to the object that you want to move in a variable. use modelunderloc or modelsunderloc to get the model you want to move, and than only move this mode.


    hondo3000 Guest

  12. #11

    Default Re: script problem

    hi hondo

    well i tried it but i think the scripting i'm try to write is not right.plz can u write a script explaning this

    thanking u
    WILLIAM
    WILLIE8768 Guest

  13. #12

    Default Re: script problem

    just copy this script into a empty behavior and drag the behavior onto a empty
    shockwave3D sprite on the stage. i just modified your script a littel bit and
    inserted a list with pairs of model and dummy object. so every model has now
    one dummy that it will snap to.

    you can drag the boxes, the dummys are the littel points next to them.

    but i would not use the spritespace to worldspace to drag the models around,
    use instead a plane that is large enough and send a modelsunderloc beam to this
    plane, the position where the beam hits the plane makes it easier to drag the
    models around because then the model will be placed exactly where the mouse
    hits the plane, at the moment you will notice that you can drag the mouse more
    than the box moves...

    hope this is a help for you

    regards!


    --*********************************************--
    property pSprite
    property pMember

    property pDrag
    property moveModel, dummymodel, pairlist, mouseStart, modelStart


    --************************************************--
    on beginSprite me
    pSprite = sprite(me.spritenum)
    pMember = pSprite.member
    pMember.resetworld()
    pDrag =false

    --## because i have no models to move i make some
    res01=pMember.newmodelresource("model", #box, #front)
    res02=pMember.newmodelresource("dummy", #sphere, #front)
    res02.radius=5
    res02.resolution=1
    --## generating a list of pairs with a model and the related dummy object
    and put them
    --## and set them to positions
    pairlist=[]
    repeat with k= 1 to 5
    repeat with j= 1 to 5
    newmod01=pMember.newmodel("dummy"& k & j, res02)
    newmod01.transform.position=vector(k*100, j*100,0)

    newmod02=pMember.newmodel("model"& k & j, res01)
    newmod02.transform.position=vector((k*100)-50, (j*100)-50,0)

    sublist=[#mover: newmod02, #dummy: newmod01]
    pairlist.add(sublist)

    end repeat
    end repeat
    --put pairlist
    end beginsprite



    on enterFrame me
    if pDrag then
    --## finding a new position by calculating the difference between the
    spritespacetoworldspace
    --## on the mousedown event and the actual position of the mousepointer
    --## not correct at the moment because the mouse doesn't stay on exactly
    above the box while
    --## dragging
    --## possible to use a large plane and find the clicked position by
    sending a ray to it. then
    --## use #isectposition to get the modelsunderloc point where the plane is
    intersected.
    theNewPos=(pMember.camera[1].spritespacetoworldspace (the
    mouseloc)-mouseStart)

    --the following depends of your world axis
    -- for example if the camera is pointing from top to bottom

    moveModel.transform.position=modelStart+theNewPos


    pPosition = moveModel.transform.position
    tposition = dummymodel.transform.position
    distance=(pPosition-tposition).magnitude --## you can use here "distanceTo"

    if distance <20 then -- for example
    moveModel.transform.position=tPosition
    pPosition=tPosition
    end if
    end if

    end enterFrame

    on mouseDown me
    --## here is now the modelsunderloc command to detect the model that is
    under the mouse
    pt = the mouseLoc - point(pSprite.left, pSprite.top)
    m = pSprite.camera.modelsUnderLoc(pt, 1, #detailed)

    --## if there is a result then find the related dummy for the clicked model
    if m<>[] then
    --## here i record the mouseStart and the modelStart to calculate on
    enterframe
    --## the newPosition of the box models
    mouseStart=pMember.camera[1].spritespacetoworldspace (the mouseloc)
    modelStart=m[1][#model].transform.position

    moveModel=m[1][#model]
    --put moveModel

    --## going through the list and find the right dummy model
    repeat with i= 1 to pairlist.count

    if moveModel=pairlist[i][#mover] then
    dummymodel=pairlist[i][#dummy]
    put pairlist[i]
    end if
    end repeat

    --## if there is a dummymodel and a model then pDrag becomes true
    if moveModel<>void and dummymodel<>void then
    pDrag=true
    end if

    end if
    end mouseDown

    on mouseUp me
    pDrag=false
    end mouseUp
    --************************************************** **

    hondo3000 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139