Help with compilation error

juancr

New Member
Licensed User
I wrote these 3 short programs which run perfect in B4Ppc but report

error when trying to compile.


Guia Marina ("Marine Guide")

Clicking on an image changes images.

Sub Image3_Click
Select fs
If fs="" Then Return
Case "a"
n=n+1
Image3.Image=ImageList1.Item(n)
If n=2 Then n=-1
Case "b"
n=n+1
Image3.Image=ImageList1.Item(n)
If n=3 Then n=0
End Select
End Sub

ERROR Syntax error. Select fs

"Inflator3" (Calculates inflation) and "CalcDes" (Calculates VS and

Time for an aircraft descent given speed, distance and altitude.


Sub Button1_Click
Control(s)=Control(s)&"1"
End Sub

ERROR Unknown control type. Use Control(name,type) instead.

Can you help please?
 

Basic4Life

Member
Licensed User
It's really unnecessary work to replicate these errors without the source code. (Please post that next time)

But here are my ideas from the top of my head.

1. error:

No If Condition after Select unless it's in a Case.
Use the empty return Condition before the Select or as a seperate Case

2. error:

Control is probably read only. So whatever you try to achieve with that sub it should probably be something like this Control(s).Text = Control(s&"1").Text whereas ".Text" is the property you want to change
If you want to switch out the complete control you'll probably have to go through all properties (There might be a method to duplicate/replace a control at runtime but I am currently not aware of that.)
 
Last edited:

mjcoon

Well-Known Member
Licensed User
It's really unnecessary work to replicate these errors without the source code. (Please post that next time)

Yes, it is necessary to know all sorts of things, such as what names are declared as global and what is an object.

If you do not wish to post all of a large program then it is fine to chop it down into just the part that shows the problem (but is still a complete fragment) and post that as the attachment.

Mike.
 
Top