Syntax or Parer....

Coding + IDE + Code-Editor + Syntax + User-Functions + Anything else

Syntax or Parer....

Postby Henning » Wed Mar 09, 2011 12:39 am

syntax error or parser error in line 34 in file frm_BedCalib.QWidget
...bType = msgBedSensRead

Code: Select all
In Global.QObject:
Public Const msgBedSensRead As Byte = 32

Type T_Msg
  bType As Byte
  ID As Int16
  bSYSTEM As Byte
  unit As Byte
  port As Byte
  bdata[7] As Byte
  ReplyTo As Int16
  crc As Int16
End Type

Public Dim BS As T_Msg

In frm_BedCalib.QWidget
  BS.bType = msgBedSensRead    'THIS IS LINE 34



/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Syntax or Parer....

Postby berndnoetscher » Wed Mar 09, 2011 8:45 am

Hi Henning,

thanks for testing q7basic.

I created an example project with your code and it works as expected. What code contains the lines above and under line 34?

CU
Bernd


Henning wrote:syntax error or parser error in line 34 in file frm_BedCalib.QWidget
...bType = msgBedSensRead

Code: Select all
In Global.QObject:
Public Const msgBedSensRead As Byte = 32

Type T_Msg
  bType As Byte
  ID As Int16
  bSYSTEM As Byte
  unit As Byte
  port As Byte
  bdata[7] As Byte
  ReplyTo As Int16
  crc As Int16
End Type

Public Dim BS As T_Msg

In frm_BedCalib.QWidget
  BS.bType = msgBedSensRead    'THIS IS LINE 34



/Henning
berndnoetscher
Site Admin
 
Posts: 344
Joined: Thu Mar 25, 2010 9:57 am

Re: Syntax or Parer....

Postby Henning » Wed Mar 09, 2011 11:13 am

This is where it is in the code in frm_BedCalib.QWidget.

Code: Select all
Signal on_cmd_ReadEmpty_clicked(Checked As Boolean)
 
  BS.bType = msgBedSensRead
  BS.ID = B6TChannel * 256 + bs_Meas5Sec
  BS.bSYSTEM = SystemPort
  BS.unit = B6T_Unit
  BS.port = 2
  BS.ReplyTo = MyPort
  BS.bdata[0] = B6TChannel
  txt_CurrAct!setTextColor = "0,0,0"
  txt_CurrAct!setText = sReadEmptyReal & sWait
'****************************
'* Call SendBSData()
'****************************
  SendBSData()
  If ReadBSData(msgBedSensRpt) Then
    txt_CurrAct!SetText = sReadEmptyReal & sDone
    txt_EmptyMin!SetText = 256 * BS_data[1] + BS_data[0]
    txt_EmptyMax!SetText = 256 * BS_data[3] + BS_data[2]
  Else
'    Beep
    txt_CurrAct!SetTextColor = "255,0,0"
    txt_CurrAct!SetText = sReadEmptyReal & sFailed
  End If
 
End Signal


Just tested to move the declarations of Type and BS to the same page (frm_BedCalib.QWidget), and then it works. When Type and BS are declared in Global.QObject it doesn't!?

Did some more testing and, from code in Module1.QObject the declares in Global.QObject works as expected!?

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm


Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 0 guests

cron