!!SETBLOCK

	$$BBS.NAME         = "モデムデータベース編集専用";
	$$BBS.TEL1         = "";
	$$BBS.TEL2         = "";
	$$BBS.TEL3         = "";
	$$BBS.ID           = "";
	$$BBS.PASSWORD     = "";
	$$BBS.TYPE         = "";
	$$BBS.LOG          = #FALSE;
	$$BBS.REDIAL       = 5;
	$$BBS.REDIAL.WAIT  = 10;

	$$COM.BAUD         = 19200;
	$$COM.DATA         = 8;
	$$COM.PARITY       = 0;
	$$COM.SBIT         = 1;
	$$COM.SOFT.FLOW    = #FALSE;
	$$COM.HARD.FLOW    = #TRUE;
	$$COM.8BIT         = #FALSE;
	$$COM.PORT         = 0;

	$$TRM.SCREEN       = "";
	$$TRM.SET.SCREEN   = #FALSE;
	$$TRM.RSTABLE      = "";
	$$TRM.SET.RSTABLE  = #FALSE;
	$$TRM.EOL          = "\r";
	$$TRM.CR.OPTION    = "\r";
	$$TRM.INPUT        = 1;
	$$TRM.KANJI.CODE   = 0;
	$$TRM.QUOTE1       = "＞";
	$$TRM.QUOTE2       = "：";
	$$TRM.QUOTE3       = "｜";
	$$TRM.BS.OPTION    = #TRUE;
	$$TRM.LOCAL.ECHO   = #FALSE;
	$$TRM.CUSTOM.JIS   = #FALSE;

	$$MDM.INIT1        = "ATZ";
	$$MDM.INIT2        = "ATM3X4&M4\\V2%X0";
	$$MDM.INIT3        = "";
	$$MDM.DEFAULT.INIT = #FALSE;
	$$MDM.CUSTOM.INIT  = #TRUE;
	$$MDM.EC.ON        = "AT\\N3";
	$$MDM.EC.OFF       = "AT\\N0";
	$$MDM.EC           = #FALSE;

	$$TTX.CHR.DELAY    = 0;
	$$TTX.LINE.DELAY   = 0;
	$$TTX.PROMPT       = "";
	$$TTX.RIGHT        = -1;
	$$TTX.LEFT         = -1;
	$$TTX.FAST         = #FALSE;
	$$TTX.INSERT.CR    = 80;
	$$TTX.AUTO.NAME    = #FALSE;
	$$TTX.NO.CODE.CONV = #FALSE;
	$$TTX.SAVE.ZERO    = #FALSE;

	$$BIN.PROTOCOL     = 3;
	$$BIN.AUTO.B       = #TRUE;
	$$BIN.AUTO.Z       = #FALSE;
	$$BIN.X.OPTION     = 0;
	$$BIN.SA.ACK       = 0;
	$$BIN.AUTO.NAME    = #FALSE;

	$$NAP.TYPE         = 0;
	$$NAP.AUTO         = #FALSE;
	$$NAP.LOG          = #FALSE;

	$$KBD.PF1          = "";
	$$KBD.SHIFT.PF1    = "";
	$$KBD.PF2          = "";
	$$KBD.SHIFT.PF2    = "";
	$$KBD.PF3          = "";
	$$KBD.SHIFT.PF3    = "";
	$$KBD.PF4          = "";
	$$KBD.SHIFT.PF4    = "";
	$$KBD.PF5          = "";
	$$KBD.SHIFT.PF5    = "";
	$$KBD.PF6          = "";
	$$KBD.SHIFT.PF6    = "";
	$$KBD.PF7          = "";
	$$KBD.SHIFT.PF7    = "";
	$$KBD.PF8          = "";
	$$KBD.SHIFT.PF8    = "";
	$$KBD.PF9          = "";
	$$KBD.SHIFT.PF9    = "";
	$$KBD.PF10         = "";
	$$KBD.SHIFT.PF10   = "";
	$$KBD.PF13         = "";
	$$KBD.SHIFT.PF13   = "";
	$$KBD.PF14         = "";
	$$KBD.SHIFT.PF14   = "";
	$$KBD.PF15         = "";
	$$KBD.SHIFT.PF15   = "";
	$$KBD.PF16         = "";
	$$KBD.SHIFT.PF16   = "";
	$$KBD.PF17         = "";
	$$KBD.SHIFT.PF17   = "";
	$$KBD.PF18         = "";
	$$KBD.SHIFT.PF18   = "";
	$$KBD.PF19         = "";
	$$KBD.SHIFT.PF19   = "";
	$$KBD.PF20         = "";
	$$KBD.SHIFT.PF20   = "";
	$$KBD.TYPE         = "";
	$$KBD.SET.TYPE     = #FALSE;

	$$COL.TRM.CHR      = 11;
	$$COL.TRM.BACK     = 9;
	$$COL.EDT.CHR      = 8;
	$$COL.EDT.BACK     = 15;

	$$TIM.HANGUP       = 10;

	$$DIR.TXT.UP       = "";
	$$DIR.TXT.DOWN     = "";
	$$DIR.BIN.UP       = "";
	$$DIR.BIN.DOWN     = "";
	$$DIR.LOG          = "";
	$$DIR.NAPLPS       = "";

	$$SND.ENDXFER      = "";
	$$SND.CONNECT      = "";
	$$SND.ERROR        = "";
	$$STATUS.BAR       = #TRUE;

!!ENDBLOCK

!!MAINBLOCK
event	@OPEN.SCRIPT {
	sys.pushCursor( 81 );
	$$USER.DEFINED.9 = #TRUE;
	loop {
		script.openExtern("MDMEDIT.MX", #FALSE, []);
		if( $$USER.DEFINED.9 != #FALSE ) {
			exit;
		} else {
			loop {
				$defFile = str.join([char( sys.bootDrive?() + 0x41 ),
									 ":\\FMCITY\\DB"], "" );
				$setBtnId = dialog.makeButton( 1, "設 定", 0, 0x8012 );
				$canBtnId = dialog.makeButton( 1, "取 消", 0, 0x8011 );
				$dialogList = ["", 0, -1, -1, $setBtnId,
					["",1024,[0],["  データベースファイル格納ディレクトリ名を",
												"入力してください。"], [""]],
					["",1032,[0x0008],["*.*","ﾃﾞｨﾚｸﾄﾘ選択","設定","取消"],
														 [$defFile]],
					["", $canBtnId, [0],       [""],       [""]    ],
					["", $setBtnId, [0],       [""],       [""]    ]
				];
				sys.pushCursor( 80 );
				dialog.open( $dialogList );
				sys.popCursor();
				dialog.delButton( $setBtnId );
				dialog.delButton( $canBtnId );
				if( list.get1st( $$DIALOG.RETURN ) == $setBtnId ) {
					$fName = list.get1st( list.getNth( $$DIALOG.RETURN, 3 ));
					if( str.right( $fName, 1 ) == "\\" ) {
						$fName = str.join([$fName,   "MODEMK"], "" );
					} else {
						$fName = str.join([$fName, "\\MODEMK"], "" );
					}
					if( file.exist( $fName ) == #FALSE ) {
						dialog.ask(["ファイルが見つかりません。",
									"",
									str.join(["ファイル名：", $fName], "" ),
									""],["確認"] );
						continue;
					}

					dialog.openMsg(["データベースを再構築しています。"],0 );
					$dataList = [];
					$corpList = gdb.getModemData1();
					foreach( $corp, $corpList ) {
						$nameList = gdb.getModemData2( $corp );
						foreach( $name, $nameList ) {
							list.putLast( $dataList,
										  gdb.getModemData3( $corp, $name ));
						}
					}
					file.delete( $fName );
					foreach( $a, $dataList ) {
						gdb.setModemData( $a );
					}
					dialog.close();
				}
				exit;
			}
		}
	}
	sys.quitSystem();
}
!!ENDBLOCK
