i was tring to write a program and when it tried to compile an erro massage appeared: left paren expected for line 7 here is my first program what is wrong? and what is a paren? any rules about the usage of a paren? Option Explicit Public Sub Main() Dim PinLogic As Byte pinLogic = GetPin (3) Do if( GetPin=1 ) then debug.print"working" call sleep(2) End Sub |
|
what is a paren?
Started by ●February 17, 2004
Reply by ●February 17, 20042004-02-17
if (getpin(3) = 1) then kongfu2008 wrote: > i was tring to write a program and when it tried to compile > an erro massage appeared: left paren expected for line 7 > here is my first program what is wrong? and what is a paren? any > rules about the usage of a paren? > > Option Explicit > > Public Sub Main() > Dim PinLogic As Byte > pinLogic = GetPin (3) > Do > if( GetPin=1 ) then > debug.print"working" > call sleep(2) > End Sub > > >. |
Reply by ●February 17, 20042004-02-17
--- In , "kongfu2008" <kongfu2008@y...> wrote: > i was tring to write a program and when it tried to compile > an error message appeared: left paren expected for line 7 To answer your question explicitly, "paren" is slang for parenthesis. Apparently, the tokenizer in BasicX requires whitespace following keywords. It seems to be complaining because the parenthesis directly follows the "if". I don't remember if Visual Basic has such a requirement or not. It could just be careless programming on the part of those who wrote the BasicX compiler. Don |
Reply by ●February 17, 20042004-02-17
Hello - Another basic, er, fundamental question here... If I use Com 1 with program I/O, how do I get back in with the host PC for further programming? Kinda a fear of pulling the rug out from under my feet. The goal is a widget that takes in data on Com 1, rearranges it, and spits it out the other Com port. The second port is no problem, but I haven't started testing Com 1 since I'm not sure where it might lead. And similarly, if wanted to use the networking feature, that shuts down Com 1 so how does the host PC get back in? Oh, and I'll be using wireless on one Com port... for testing it goes wireless module -> RS232 -> BX-35, but eventually can eliminate the RS232 conversions and keep everything at 5 volt TTL just like someone else was talking about doing. _________ Jim Coate 1970's Elec-Trak 1992 Chevy S-10 BEV 1997 Chevy S-10 NGV http://www.eeevee.com |
Reply by ●February 18, 20042004-02-18
From: Don Kinzer <> > kongfu2008 <kongfu2008@y...> wrote: >> >> i was tring to write a program and when it tried >> to compile an error message appeared: left paren >> expected for line 7 >> [...] >> if( GetPin=1 ) then > > To answer your question explicitly, "paren" is > slang for parenthesis. > > Apparently, the tokenizer in BasicX requires > whitespace following keywords. It seems to be > complaining because the parenthesis directly > follows the "if". [...] GetPin is a function that needs an argument -- that's where the parens come in, as Neil indicated. Keywords don't generally require whitespaces to surround them. As an example, both of these statements are legal: If (B = 3) Then If(B=3)Then -- Frank Manning -- NetMedia, Inc. |