#=============================================================================================
# @TITLE					WebDBM - initial test script.
#
# @NUMBER					init
#
# @DESCRIPTION				Sets all global variables.
#
# @EXP_RESULT				
#
# @REQUIREMENTS				
#=============================================================================================

public new_interface =  "1"; # 1 for new, 0 for old

#=============================================================================================
# @STEP 1					Setting global variables.	
#=============================================================================================
public scriptFilePath = "D:\\WinRunner\\WEBDBM\\";
public version = "7.6.00";
public version_inst = "7.6.0";
public QA_Level = "DEV";
public database = "WD760D";
public www_server = "P48123";
public port = "9999";

public remote = "false";

public server;
if (remote == "false")
{
	server = "localhost";
}
else
{
	server = "P38387";
}

public guiFilePath = scriptFilePath & "GUIFiles\\";
public qa_Level;
if (QA_Level == "COR")
	qa_Level = "cor";
if (QA_Level == "DEV")
	qa_Level = "dev";
if (QA_Level == "RAMP")
	qa_Level = "ramp";

public serverUser					= "SAP_ALL\\D043486";
public serverUserPassword			= "dde2d0328270c6c4";	
	
public detail_window				= "Details";
public navi_window					= "Navigation";
public status_window				= "Status";

public main_window					= "const";
public work_window					= "const";
public state_window					= "const";
public menu_window					= "const";
public header_window				= "const";

if (version == "7.3.00") {
	
	main_window						= "Main";
	work_window						= "Work";
	state_window					= "State";
	menu_window						= "Menu";
	header_window					= "Header";
} else {
	
	main_window						= "main";
	work_window						= "work";
	state_window					= "state";
	menu_window						= "menu";
	header_window					= "header";
}

public webdbm_main_window_name		= "Main";
public webdbm_dsql_window_name		= "dsql";
public webdbm_result_window_name	= "result";
public webdbm_header_window_name	= "Header";

public user							= "SQLREISEN00";
public user_10						= "SQLREISEN10";
public user_20						= "SQLREISEN20";
public password						= "REISEN00";
public password_10					= "REISEN10";
public password_20 					= "REISEN20";
public user_dba						= "dbm";
public password_dba					= "dbm";

#public current_760x_version			= "7.6.0.0";
#public current_750x_version			= "7.5.0.0";
#public current_743x_version			= "7.4.3.0";
#public current_730x_version			= "7.3.0.0";
#=============================================================================================
# 			URLs
#=============================================================================================
public url_waadmin = "http://" & www_server & ":" & port & "/waadmin.wa";
public url_webdbm = "http://" & www_server & ":" & port & "/webdbm";
################################################################################ 
# 
# is_numeric(); 
# 
# This function returns "-1" (True) if a string passed in is completely numeric. 
# 
# Arguments are: sValue 
# Example - The following example sets x to "Letters": 
# if (is_numeric("Cat")) 
# x = "Numbers"; 
# else 
# x = "Letters"; 
# 
################################################################################ 

public function is_numeric(sValue)
{
	auto iPointer, iValueLength, iIsNumeric;
	iIsNumeric = -1; #True
	iValueLength = length(sValue);
	for (iPointer=0; iPointer < iValueLength; iPointer++) {
	
		if (ascii(substr(sValue, iPointer, 1)) < 48 || ascii(substr(sValue, iPointer, 1)) > 57) { 
			iIsNumeric = 0; #False
		}
	}
	return iIsNumeric;
}

generator_add_function("is_numeric","This function returns "-1" (True) if a string passed in is completely numeric.", 1, "sValue","type_edit","");
generator_add_function_to_category("General","is_numeric");
