On Thu, Aug 9, 2012 at 12:35 PM, rocko <sunblast...@gmail.com> wrote:
> Ok if I replace the 'Else If' with an 'Else'
> I get an error:
> Else without If.
> But there is an 'If' after the 'Try'.
> unless you can't put an 'Else' after an 'Try...If'

Ah! No you can't use

  Try If blahblahblah

(and there are some other things you can't "TRY", I can't think of
them at the moment)

Be very aware of what "TRY" actually does!

Oh and by the way, to test if a connection is already open, the
function you need is
   <Connection>.Opened()

So,

Try $conn.Open()
If Error then
  Print "Not Open"
Else
  Print "Opened it!"
End If

or

$conn.Open
If $conn.Opened() then
  Print "Not Open"
Else
  Print "Opened it!"
End If

should both work.

hth
Bruce

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to