Sub Process_globals
Type SessionSettings (Time As Int, Tempo As Int, PGfactor As Int)
Type ClvValue (ExerciseID As Int,Frequency As Double,Time As Double,ExerciseText As String,PriorityGroup As Boolean,VideoAvailable As Boolean, selected As Boolean,code As String)
End Sub
Sub Activity_Create(firsttime As Boolean)
create_untitled
End Sub
Sub create_untitled()
Dim Session As SessionSettings 'custom type
Dim exercise As ClvValue 'custom type
Dim raf As RandomAccessFile
Dim NewList As List
NewList.Initialize
'assigning values to custom type Session members
Session.Time=10
Session.Tempo=70
Session.PGfactor=5
'adding Session object to the List
NewList.Add(Session)
'assigning values to custom type Exercise members
exercise.ExerciseID = 1
exercise.Frequency = 5
exercise.Time= 2
exercise.ExerciseText = "One"
exercise.PriorityGroup = True
exercise.VideoAvailable = False
exercise.selected = True
exercise.code = ""
'adding Exercise object to the list
NewList.Add(Exercise)
'writing the NewList to the file
raf.initialize(File.DirRootExternal&"/impromptu","untitled.imp",False)
raf.WriteB4XObject(NewList,0)
raf.Close
End Sub