Kirix Support Forums

kick out of a function

Please post any help questions, requests or other feedback here.

kick out of a function

Postby abenitez77 on Fri Feb 17, 2012 9:30 am

I want to know how to kick out of a function. This is my code..

function onButtonClicked()
{
//Connection
var db
var sqlID
var dbID
var tblID

sqlID = 0;
dbID = 0;
tblID = 0;

db = new DbConnection("mssql://USATL02PRSQ70" + textbox.getText() + ":1434/AS_PROJECTS");

//if (db.isConnected()) alert("Connection succeeded");
//else alert("Connection failed");

if (ServerName.getText().length > 1)
{
var result1 = db.execute("select SQLServerID from SQLServer WHERE SQLServer = '" + ServerName.getText() + "'");
// get the first row
result1.next();

// get the field
var rowcount = result1.rowcount;
//if (result1.hasNext()) sqlID = result1.SQLServerID;
if (rowcount < 1)
{
sqlID = result1.SQLServerID;
}
else
{
....here I would want to kick out of the button function.....
}
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Re: kick out of a function

Postby Aaron on Tue Feb 21, 2012 1:54 pm

Use "return". So:

Code: Select all
if (rowcount < 1)
{
    sqlID = result1.SQLServerID;
}
else
{
    return;
}
Aaron Williams
Kirix Support Team
User avatar
Aaron
Kirix Support Team
 
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Return to Strata Help & Feedback