Help with Compiler error

Simontelescopium

Member
Licensed User
Hi I am trying to compile a prog. and get the error

Error compiling program.
Error message: error CS1525: Invalid expression term ';'
Line Number: 43
Line AddLabel("systeminfo","labPname",5,currentheight,470, sizeoffont+10)


programs runs fine just can't compile

these are the relevant bits of the code...
B4X:
41: sizeoffont= 18
42: currentheight=140
43: AddLabel("systeminfo","labPname",5,currentheight,470,sizeoffont+10)

from the error I was expecting to find ';' in the code on line 43 but it is not there, so I am stuck as to what to do...

Any help really appreciated...
 

klaus

Expert
Licensed User
Longtime User
If you look at the help file for AddLabel:
Adds a Label to a Form or to a Panel at runtime.
Syntax: AddLabel (Form | Panel, Name, Left, Top, Width, Height, Text)

Example: AddLabel ("pnlOptions"," Label1", 5, 5, 40, 20, "Option:")
You are missing the last parameter, the text of the label.

Your line should look like:​

B4X:
43: AddLabel("systeminfo","labPname",5,currentheight,470,sizeoffont+10,"")
Even if there is no text in the label you must add the 2 Quotes.

Best regards.​
 

Simontelescopium

Member
Licensed User
Brilliant thanks - I was adding the text a few lines later - I would really expect this to give an error when running in interpreter mode.

I really appreciate your help
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…