package Box.Control;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class param {
private static param mostCurrent = new param();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 public anywheresoftware.b4a.keywords.Common __c = null;
public Box.Control.main _main = null;
public Box.Control.starter _starter = null;
public Box.Control.agent _agent = null;
public Box.Control.s1 _s1 = null;
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 3;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 8;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _read_file_setup(anywheresoftware.b4a.BA _ba,String _file_name,anywheresoftware.b4a.objects.collections.List _read_data) throws Exception{
ResumableSub_read_file_setup rsub = new ResumableSub_read_file_setup(null,_ba,_file_name,_read_data);
rsub.resume((_ba.processBA == null ? _ba : _ba.processBA), null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_read_file_setup extends BA.ResumableSub {
public ResumableSub_read_file_setup(Box.Control.param parent,anywheresoftware.b4a.BA _ba,String _file_name,anywheresoftware.b4a.objects.collections.List _read_data) {
this.parent = parent;
this._ba = _ba;
this._file_name = _file_name;
this._read_data = _read_data;
}
Box.Control.param parent;
anywheresoftware.b4a.BA _ba;
String _file_name;
anywheresoftware.b4a.objects.collections.List _read_data;
anywheresoftware.b4a.objects.streams.File.TextReaderWrapper _reader = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
try {

        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 61;BA.debugLine="Dim reader As TextReader";
_reader = new anywheresoftware.b4a.objects.streams.File.TextReaderWrapper();
 //BA.debugLineNum = 63;BA.debugLine="Try";
if (true) break;

case 1:
//try
this.state = 12;
this.catchState = 11;
this.state = 3;
if (true) break;

case 3:
//C
this.state = 4;
this.catchState = 11;
 //BA.debugLineNum = 64;BA.debugLine="reader.Initialize(File.Openinput(File.DirDefault";
_reader.Initialize((java.io.InputStream)(anywheresoftware.b4a.keywords.Common.File.OpenInput(anywheresoftware.b4a.keywords.Common.File.getDirDefaultExternal(),_file_name).getObject()));
 //BA.debugLineNum = 65;BA.debugLine="Read_data = reader.ReadList";
_read_data = _reader.ReadList();
 //BA.debugLineNum = 66;BA.debugLine="reader.Close";
_reader.Close();
 //BA.debugLineNum = 68;BA.debugLine="If Read_data.Size=0 Then";
if (true) break;

case 4:
//if
this.state = 9;
if (_read_data.getSize()==0) { 
this.state = 6;
}else {
this.state = 8;
}if (true) break;

case 6:
//C
this.state = 9;
 //BA.debugLineNum = 69;BA.debugLine="Return False";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.False));return;};
 if (true) break;

case 8:
//C
this.state = 9;
 //BA.debugLineNum = 71;BA.debugLine="Return True 'Read_data";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.True));return;};
 if (true) break;

case 9:
//C
this.state = 12;
;
 if (true) break;

case 11:
//C
this.state = 12;
this.catchState = 0;
 //BA.debugLineNum = 74;BA.debugLine="Return False";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.False));return;};
 //BA.debugLineNum = 75;BA.debugLine="ToastMessageShow(\"Lecture des données impossible";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Lecture des données impossible"),anywheresoftware.b4a.keywords.Common.True);
 if (true) break;
if (true) break;

case 12:
//C
this.state = -1;
this.catchState = 0;
;
 //BA.debugLineNum = 78;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e0);}
            }
        }
    }
}
public static anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _write_file_setup(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.List _data,String _file_name,boolean _append_data,boolean _writeconf) throws Exception{
ResumableSub_write_file_setup rsub = new ResumableSub_write_file_setup(null,_ba,_data,_file_name,_append_data,_writeconf);
rsub.resume((_ba.processBA == null ? _ba : _ba.processBA), null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_write_file_setup extends BA.ResumableSub {
public ResumableSub_write_file_setup(Box.Control.param parent,anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.List _data,String _file_name,boolean _append_data,boolean _writeconf) {
this.parent = parent;
this._ba = _ba;
this._data = _data;
this._file_name = _file_name;
this._append_data = _append_data;
this._writeconf = _writeconf;
}
Box.Control.param parent;
anywheresoftware.b4a.BA _ba;
anywheresoftware.b4a.objects.collections.List _data;
String _file_name;
boolean _append_data;
boolean _writeconf;
anywheresoftware.b4a.objects.streams.File.TextWriterWrapper _writer = null;
String _info = "";
anywheresoftware.b4a.BA.IterableList group9;
int index9;
int groupLen9;
anywheresoftware.b4a.BA.IterableList group25;
int index25;
int groupLen25;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
try {

        switch (state) {
            case -1:
{
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 12;BA.debugLine="Dim Writer As TextWriter";
_writer = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
 //BA.debugLineNum = 13;BA.debugLine="If Writeconf=False Then";
if (true) break;

case 1:
//if
this.state = 36;
if (_writeconf==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 3;
}else {
this.state = 20;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 15;BA.debugLine="If append_data=False Then";
if (true) break;

case 4:
//if
this.state = 9;
if (_append_data==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 6;
}else {
this.state = 8;
}if (true) break;

case 6:
//C
this.state = 9;
 //BA.debugLineNum = 16;BA.debugLine="Writer.Initialize(File.OpenOutput(File.DirDefau";
_writer.Initialize((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirDefaultExternal(),_file_name,anywheresoftware.b4a.keywords.Common.False).getObject()));
 if (true) break;

case 8:
//C
this.state = 9;
 //BA.debugLineNum = 18;BA.debugLine="Writer.Initialize(File.OpenOutput(File.DirDefau";
_writer.Initialize((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirDefaultExternal(),_file_name,anywheresoftware.b4a.keywords.Common.True).getObject()));
 if (true) break;
;
 //BA.debugLineNum = 21;BA.debugLine="Try";

case 9:
//try
this.state = 18;
this.catchState = 17;
this.state = 11;
if (true) break;

case 11:
//C
this.state = 12;
this.catchState = 17;
 //BA.debugLineNum = 23;BA.debugLine="For Each info As String In data";
if (true) break;

case 12:
//for
this.state = 15;
group9 = _data;
index9 = 0;
groupLen9 = group9.getSize();
this.state = 37;
if (true) break;

case 37:
//C
this.state = 15;
if (index9 < groupLen9) {
this.state = 14;
_info = BA.ObjectToString(group9.Get(index9));}
if (true) break;

case 38:
//C
this.state = 37;
index9++;
if (true) break;

case 14:
//C
this.state = 38;
 //BA.debugLineNum = 24;BA.debugLine="Writer.WriteLine(info)";
_writer.WriteLine(_info);
 if (true) break;
if (true) break;

case 15:
//C
this.state = 18;
;
 //BA.debugLineNum = 27;BA.debugLine="Writer.Close";
_writer.Close();
 //BA.debugLineNum = 28;BA.debugLine="Return True";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.True));return;};
 if (true) break;

case 17:
//C
this.state = 18;
this.catchState = 0;
 //BA.debugLineNum = 30;BA.debugLine="ToastMessageShow(\"Sauvegarde impossible\", True)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Sauvegarde impossible"),anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 31;BA.debugLine="Return False";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.False));return;};
 if (true) break;
if (true) break;

case 18:
//C
this.state = 36;
this.catchState = 0;
;
 if (true) break;

case 20:
//C
this.state = 21;
 //BA.debugLineNum = 35;BA.debugLine="If append_data=False Then";
if (true) break;

case 21:
//if
this.state = 26;
if (_append_data==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 23;
}else {
this.state = 25;
}if (true) break;

case 23:
//C
this.state = 26;
 //BA.debugLineNum = 36;BA.debugLine="Writer.Initialize(File.OpenOutput(File.DirDefau";
_writer.Initialize((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirDefaultExternal(),_file_name,anywheresoftware.b4a.keywords.Common.False).getObject()));
 if (true) break;

case 25:
//C
this.state = 26;
 //BA.debugLineNum = 38;BA.debugLine="Writer.Initialize(File.OpenOutput(File.DirDefau";
_writer.Initialize((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirDefaultExternal(),_file_name,anywheresoftware.b4a.keywords.Common.True).getObject()));
 if (true) break;
;
 //BA.debugLineNum = 41;BA.debugLine="Try";

case 26:
//try
this.state = 35;
this.catchState = 34;
this.state = 28;
if (true) break;

case 28:
//C
this.state = 29;
this.catchState = 34;
 //BA.debugLineNum = 43;BA.debugLine="For Each info As String In data";
if (true) break;

case 29:
//for
this.state = 32;
group25 = _data;
index25 = 0;
groupLen25 = group25.getSize();
this.state = 39;
if (true) break;

case 39:
//C
this.state = 32;
if (index25 < groupLen25) {
this.state = 31;
_info = BA.ObjectToString(group25.Get(index25));}
if (true) break;

case 40:
//C
this.state = 39;
index25++;
if (true) break;

case 31:
//C
this.state = 40;
 //BA.debugLineNum = 44;BA.debugLine="Writer.WriteLine(info)";
_writer.WriteLine(_info);
 if (true) break;
if (true) break;

case 32:
//C
this.state = 35;
;
 //BA.debugLineNum = 47;BA.debugLine="Writer.Close";
_writer.Close();
 //BA.debugLineNum = 48;BA.debugLine="Return True";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.True));return;};
 if (true) break;

case 34:
//C
this.state = 35;
this.catchState = 0;
 //BA.debugLineNum = 50;BA.debugLine="ToastMessageShow(\"Sauvegarde impossible\", True)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Sauvegarde impossible"),anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 51;BA.debugLine="Return False";
if (true) {
anywheresoftware.b4a.keywords.Common.ReturnFromResumableSub(this,(Object)(anywheresoftware.b4a.keywords.Common.False));return;};
 if (true) break;
if (true) break;

case 35:
//C
this.state = 36;
this.catchState = 0;
;
 if (true) break;

case 36:
//C
this.state = -1;
;
 //BA.debugLineNum = 57;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e0);}
            }
        }
    }
}
}
