Buenas tardes, tengo un ejemplo que descargue en donde se graba un archivo.bat en DirDefaultExternal, hasta ahi esta bien, el programa crea un archivo.bat en el que posteriormente se manipulan los datos, la misma estructura la pasoen un archivo nuevo y deja de generar el archivo.bat.
No entiendo, sera acaso que el ejemplo se genero con otra version mas antiguia de B4A?
Manejo la version 9.8 y el ejemplo es el siguiente :
------------------------------------------------------------------------------------------------------------------------
#Region Project Attributes
#ApplicationLabel: SaveVar2File
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Lista As List
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private EditText1 As EditText
Private Button1 As Button
Private ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
If Lista.IsInitialized = False Then Lista.Initialize
Lista.Clear
If File.Exists(File.DirDefaultExternal, "score.txt") = True Then
Lista = File.ReadList(File.DirDefaultExternal, "score.txt")
For i = 0 To Lista.Size - 1
ListView1.AddSingleLine(Lista.Get(i))
Next 'i
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
ListView1.AddSingleLine(EditText1.Text)
Lista.Add(EditText1.Text)
File.WriteList(File.DirDefaultExternal, "score.txt", Lista)
End Sub
----------------------------------------------------------------------------------------
Gracias de antemano!!!
No entiendo, sera acaso que el ejemplo se genero con otra version mas antiguia de B4A?
Manejo la version 9.8 y el ejemplo es el siguiente :
------------------------------------------------------------------------------------------------------------------------
#Region Project Attributes
#ApplicationLabel: SaveVar2File
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Lista As List
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private EditText1 As EditText
Private Button1 As Button
Private ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
If Lista.IsInitialized = False Then Lista.Initialize
Lista.Clear
If File.Exists(File.DirDefaultExternal, "score.txt") = True Then
Lista = File.ReadList(File.DirDefaultExternal, "score.txt")
For i = 0 To Lista.Size - 1
ListView1.AddSingleLine(Lista.Get(i))
Next 'i
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
ListView1.AddSingleLine(EditText1.Text)
Lista.Add(EditText1.Text)
File.WriteList(File.DirDefaultExternal, "score.txt", Lista)
End Sub
----------------------------------------------------------------------------------------
Gracias de antemano!!!