4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Problem with script
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Tue Oct 21, 2003 9:46 am (14 years, 1 month ago) Reply with QuoteBack to Top

Hi all,

I've got a script we're one of the parts is as follows:

if ($corpos==1){
$body="SOL";
&SOL($JD);
if ($epoch =~ /ON/gi){
&EQ_EPOCH($JD,$J2000,$RA,$DE);
&EC_EPOCH($JD,$J2000,$L,$B);
}
&JD2DATE ($JD,$Date);
&FORMAT_RA_DE($RA,$DE);
&FORMAT_L_B($L,$B);
&middle;
#mark
$body="MER";
&MER($JD);
if ($epoch =~ /ON/gi){
&EQ_EPOCH($JD,$J2000,$RA,$DE);
&EC_EPOCH($JD,$J2000,$L,$B);
}
&FORMAT_RA_DE($RA,$DE);
&FORMAT_L_B($L,$B);
&middle;
$body="VEN";
&VEN($JD);
if ($epoch =~ /ON/gi){
&EQ_EPOCH($JD,$J2000,$RA,$DE);
&EC_EPOCH($JD,$J2000,$L,$B);
}
&FORMAT_RA_DE($RA,$DE);
&FORMAT_L_B($L,$B);
&middle;
$body="MAR";
&MAR($JD);
if ($epoch =~ /ON/gi){
&EQ_EPOCH($JD,$J2000,$RA,$DE);
&EC_EPOCH($JD,$J2000,$L,$B);
}
&FORMAT_RA_DE($RA,$DE);
&FORMAT_L_B($L,$B);
&middle;
&footer;
exit;
}

The problem is that when I run the program, the script only executes until the «mark»; the rest it completly ignores it. The routines are all there. Does someone have any idea why this is happening?

This is very urgent.

Best regards,
OfflineView User's ProfileFind all posts by keplerSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Tue Oct 21, 2003 1:30 pm (14 years, 1 month ago) Reply with QuoteBack to Top

I assume this is perl?

it's hard to say what the problem is without some more information; most importantly what are the values of the variables and where do they come from?

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Tue Oct 21, 2003 6:58 pm (14 years, 1 month ago) Reply with QuoteBack to Top

Of course is perl - sorry I didn't mencioned.

The variables come from an html page with a single form. There are a second routine wich also doesn't work; it seems the script can't process several subroutines calls in the same if statement - that what it seems to me, and it makes no sense.

Is there another way to call a routine without the & (&SOL($JD) for example) operator that I can try?

Best regards,
OfflineView User's ProfileFind all posts by keplerSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Wed Oct 22, 2003 12:10 pm (14 years, 1 month ago) Reply with QuoteBack to Top

you should just be able to call a routine without the & symbol, you your example would be SOL($JD) - but I'm not sure if that would make a difference.

I think the most likely cause is that something is calling exit somewhere in the script...can you post the definition for middle? since that's right before the mark

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Wed Oct 22, 2003 1:08 pm (14 years, 1 month ago) Reply with QuoteBack to Top

Hi again,

The problem is already solved. It was in the &middle routine; it was trying to calculate the square root of a negative number. But instead of generating an error message, it exited the program.

( computers are always right ) Shocked

Thanks for the help.

Best regards,
OfflineView User's ProfileFind all posts by keplerSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat Oct 25, 2003 4:16 pm (14 years, 1 month ago) Reply with QuoteBack to Top

ah right I see, I love it when useful error messages don't get displayed Rolling Eyes

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.072828 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme