472,993 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

buggie in else syntax ?

hello,

I've the idea that the "else" syntax is not always handled correctly,
or I'm overlooking something.

This pieces of code are automatic translation from another language,
sometimes it works, sometimes it doesn't ???

This piece of code works nice:

a = 2

def JSM (line_nr):
print line_nr

if a>3:
print 'asddas'
else: JSM(230) ; \ <== this is the problem line, that's ok here
print 'aaps'

While this piece of code gives a syntax error:

#Function button_antidender(bit in pin,sbyte in out
Button_Counter_Temp,byte in demp) return bit is
def button_antidender ( pin, button_counter_temp, demp ):
#serial_hw_write(counter)
Serial_HW_Write ( button_counter_temp ) ;JSM(226)
if JSM(227) and ( button_counter_temp >= 0 ):
if JSM(228) and ( pin == on ):
button_counter_temp = button_counter_temp + 1
;JSM(229)
else: JSM(230) ;
\ <=== SYNTAX ERROR
button_counter_temp = 1
;JSM(231)

Traceback (most recent call last):
File "D:\data_to_test\JALsPy\JALsPy.py", line 347, in ?
Run_JALsPy_Application ()
File "D:\data_to_test\JALsPy\JALsPy.py", line 327, in
Run_JALsPy_Application
JG.app.MainLoop()
File "D:\data_to_test\JALsPy\JALsPy.py", line 255, in MainLoop
import JAL_simulation_file
File "D:\data_to_test\JALsPy\JAL_simulation_file.py ", line 265
else: JSM(230) ; \

I guess it's not the preferred syntax, but the resemblance with the
original language it optimal.
Why is it sometimes accepted an sometimes give an error message ?

thanks,
Stef Mientki
Aug 14 '07 #1
0 783

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jim Michaels | last post by:
C:\prj\quiz\withusers>php tareports.php PHP Parse error: syntax error, unexpected T_ELSE in C:\prj\quiz\withusers\tareports.php on line 205 this is the section of code. if (isset($row4)) {...
7
by: alf | last post by:
Hi, I wonder why it is an invalid syntax: File "<stdin>", line 1 if 1: if 1: if 1: print 1 or
6
by: Nathan Pinno | last post by:
Why does my compiler say invalid syntax and then highlight the quotation marks in the following code: # This program is to find primes. primes = import math import gmpy while 1: run =...
0
by: papafreebird | last post by:
I'm starting to code using linux codeblocks IDE and GCC compiler to create a wxwidgets gui. I have experience coding gui's in c++ builder 6 with no problems but now that I am trying to code in linux...
3
by: sandromani | last post by:
Hi all, I am writing a webbased notepad and want to include syntax-coloring. The approach I have used is to set the font color and background color of the textarea to transparent, and place the...
13
by: Neal Becker | last post by:
In hindsight, I am disappointed with the choice of conditional syntax. I know it's too late to change. The problem is y = some thing or other if x else something_else When scanning this my...
2
by: klaul | last post by:
Hoping someone can help me here! I'm having some problems trying to get the right syntax for a view, and am wondering if someone could point me in the right direction! My code is currently: ...
6
Soniad
by: Soniad | last post by:
Hello, I am excecuting a stored procedure in my ASP page , it has one out parameter (@confirm) . after executing the procedure i want to retreive this out parameter and assign it to variable...
3
by: broll911 | last post by:
I am gettin a error message on this script can someone help me. I am a complete newbie on this stuff. Thanks in advance for any help you can give me. here is the error. Parse error: syntax error,...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.