Author Topic: Help with TBasic Syntax  (Read 11533 times)

peterjung

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Help with TBasic Syntax
« on: February 10, 2016, 06:39:40 PM »
Can someone tell me what is wrong with the following code:

'Get the Set Value of the timer and store in a variable

ElapsedTimeSVFor = getTimerSV(4)
ElapsedTimeSVRev = getTimerSV(5)

'Elapsed Time Forward Display

IF TESTIO(SBX_LSR)=0 '& TESTIO(SBX_LSF)=0 & TESTIO(LSF_LATCH)=0)
THEN
ElapsedTimeDisplay = ElapsedTimeSVFor - TIMERPV[4]
ELSEIF TESTIO(SBX_LSR)=0 & TESTIO(LSF_LATCH)=1
THEN
ElapsedTimeDisplay = ElapsedTimeSVFor - TIMERPV[5]
ELSE
ElapsedTimeDisplay = 0
ENDIF

I get a message:

Error:Syntax error, missing: "]" with the last square bracket after TIMERPV[4] highlighted?

Thanks

peterjung

  • Newbie
  • Posts: 9
  • I'm a llama!
    • View Profile
Re:Help with TBasic Syntax
« Reply #1 on: February 10, 2016, 07:48:53 PM »
OK...I found the problem....

My variable called "ElapsedTimeDisplay" was defined in the "Define Variable Names" table as:

DM[3}

..... where of course it should be:

DM[3]

arrrgghhh!!