Error in Routines
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
Error in Routines
Hi,
I am getting the folowwing error in my routine 1 Errors detected, No Object Code Produced. Can any one help me on this....
I am getting the folowwing error in my routine 1 Errors detected, No Object Code Produced. Can any one help me on this....
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
Try this
![Razz :P](./images/smilies/icon_razz.gif)
Code: Select all
month = ''
day = ''
yr = ''
Date = ''
ay = ''
month = PD[6,7] - Counter
If month <= 0 then
day = PD[9,10]
yr = PD[1,4]
month = 12
yr = yr - 1
Date = yr:"-":month:"-":day
End
If month > 0 then
day = PD[9,10]
yr = PD[1,4]
Date = yr:"-":month:"-":day
End
Ans = Date
![Razz :P](./images/smilies/icon_razz.gif)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
in your original code. you missed one one End. and there is no semicolon used after the last End.
heres your code. and the changes in bold
month = PD[6,7] - Counter
If month <= 0 then
day = PD[9,10]
yr = PD[1,4]
month = 12
yr -= 1
Date = yr:'-':month:'-':day
End
Else
day = PD[9,10]
yr = PD[1,4]
Date = yr:'-':month:'-':day
End
Ans = Date
Also, it would be nice if you could initilize the variables you are using. Otherwise you will see a warning in the director.
heres your code. and the changes in bold
month = PD[6,7] - Counter
If month <= 0 then
day = PD[9,10]
yr = PD[1,4]
month = 12
yr -= 1
Date = yr:'-':month:'-':day
End
Else
day = PD[9,10]
yr = PD[1,4]
Date = yr:'-':month:'-':day
End
Ans = Date
Also, it would be nice if you could initilize the variables you are using. Otherwise you will see a warning in the director.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
Look at my previous post. The problem was not that you forgot to initilize the variables. The compiler wont give you the error that you were getting if you dont initize the variables.
Your problem was that you were missing one End.
for eg
The problem in your code was that you were missing the 'End' after statement 3 in my eg. above. Also you had a trailing semicolon ; after your last End.
Thats why the compiler was spitting back the code because it was not able to recognize the syntax.
Your only issue was syntax. And not the initilizing of the variables., if you dont initilize your variables, you will see a warning in the director (log files) and not while compiling and testing the routine.
I hope that helps![Smile :)](./images/smilies/icon_smile.gif)
Your problem was that you were missing one End.
for eg
Code: Select all
if (condition) then
statement 1
statement 2
statement 3
End
else
statement 7
statement 8
statement 9
End
Thats why the compiler was spitting back the code because it was not able to recognize the syntax.
Your only issue was syntax. And not the initilizing of the variables.
Code: Select all
BUT
I hope that helps
![Smile :)](./images/smilies/icon_smile.gif)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am