Navigation:  thinBasic Modules > OnLineScores >

OnlineScores_GetConnectionState

Previous pageReturn to chapter overviewNext page

 

Description

 

Retrieves the connected state of the local system.

 

Syntax

 

iFlag = OnlineScores_GetConnectionState()

 

Returns

 

Number.

Returns %FALSE if there is no Internet connection, or if all possible Internet connections are not currently active.

Returns a value different from %FALSE if there is an active modem or a LAN Internet connection.

See remarks.

 

Parameters

 

Name

Type

Optional

Meaning





 

Remarks

 

A positive return value indicates that at least one connection to the Internet is available. It does not guarantee that a connection to a specific host can be established.

 

A positive return value indicates that either the modem connection is active, or a LAN connection is active and a proxy is properly configured for the LAN.

A return value of %FALSE indicates that neither the modem nor the LAN is connected.

 

A positive return value contains one or more of the following flags set:

%INTERNET_CONNECTION_MODEM

%INTERNET_CONNECTION_LAN

%INTERNET_CONNECTION_PROXY

%INTERNET_CONNECTION_MODEM_BUSY

%INTERNET_RAS_INSTALLED

%INTERNET_CONNECTION_OFFLINE

%INTERNET_CONNECTION_CONFIGURED

 

Use AND to check for active options.

 

Restrictions

 

See also

 

Examples

 

Dim lConFlags   As Long

 

PRINTL "OnLineScores module needs to connect to Internet. Checking connection ..."

lConFlags = OnlineScores_GetConnectionState

If lConFlags = %False Then

  PRINTL "... it seems you are not connected to Internet"

  PRINTL "Press a key to end script"

  WAITKEY

  STOP

Else

  PRINTL "... your public IP is:", OnlineScores_GetTestingData(%OLS_Test_PublicIP)

  Print "... determining connection type: "

  If lConFlags And %OLS_CONNECTION_MODEM Then Print "Modem "

  If lConFlags And %OLS_CONNECTION_LAN   Then Print "Lan "

  If lConFlags And %OLS_CONNECTION_PROXY Then Print "Proxy "

  PRINTL

  PRINTL "... it seems you are connected to Internet so script can proceed."

End If

PRINTL "-----------------------------------------------------------------------"