Ask a Question related to ASP, Design and Development.
-
Freeserve #1
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
-
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... -
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... -
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,... -
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... -
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... -
Stuart Palmer #2
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...True)> 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,>
> 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
-
Freeserve #3
Re: script problem
Yes. That fixed it. Thanks.
"Stuart Palmer" <tryandspamme@youcant.com> wrote in message
news:bljl6f$1e6k$1@sp15at20.hursley.ibm.com...to> 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...> True)> > 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,> >
> > 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>> > free things up.
> >
> > Any ideas why this won't work?
> >
> >
>
Freeserve Guest
-
Leon #4
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
-
Dan Muey #5
RE: script problem
Howdy.> Hi everyone,
use strict;>
> I am created this script to send e-mails (see below).
> I get this error when I try to run it:
>
use warnings;
Most likely, yes you need to escape quotes that are within quotes.> 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.
So "
Becomes \"
You could also use qq() or a HERE doc:
my $var = <<TEXT;
Blah
Blah bla "" blah
TEXT
HTH
DMuey[url]http://webhosting.yahoo.com/ps/sb/[/url]>
> 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!
--
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
-
Eternius #6
Re: script problem
Leon wrote:
you have to \" in strings.> 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]
Eternius Guest
-
Paul Kraus #7
RE: script problem
> event, or "0" if unavailable is: $ARGV[8]
Escape the \"0\"
Paul Kraus Guest
-
R. Joseph Newton #8
Re: script problem
Eternius wrote:
> Leon wrote:> > Hi everyone,> > # another 50 or so lines of original post# snugged up tightly to the bottom of boilerplate:> > $smtp->quit;
Please trim original text and provide some visible indication of> you have to \" in strings.> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free web site building tool. Try it!
> > [url]http://webhosting.yahoo.com/ps/sb/[/url]
where your responses begin. That was useful and correct feedback,
but almost lost in context.
Joseph
R. Joseph Newton Guest
-
WILLIE8768 #9
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
-
hondo3000 #10
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
-
WILLIE8768 #11
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
-
hondo3000 #12
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



Reply With Quote

