Dear Cerberus X User!
As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.
Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.
Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!
Accepting ensures:
- Continued access to your account with a short break for the actual transfer.
- Retention of your data under the same terms.
Without consent:
- You don't have further access to your forum user account.
- Your account and personal data will be deleted after April 5, 2024.
- Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.
We hope to keep you in our community and see you on the forum soon!
All the best
Your Cerberus X Team
Strict
Import mojo2
Import brl
Import brl.FileSystem
Function Main:Int()
New myClass
Return 0
End
Class myClass Extends App
Field so:String[], canvas:Canvas, bg:Image
Method OnCreate:Int()
SetUpdateRate 0
canvas = New Canvas
' Write file
Local s:String
s = "brian~nJohn~nPeter"
Local fw:= FileStream.Open("cerberus://internal/test2.txt","w")
'Local fw:= FileStream.Open("cerberus://external/DCIM/Camera/test4.txt","w")
If fw <> Null
Print "File open to write"
fw.WriteString(s)
fw.Close()
Else
Print "File not open to write"
Endif
' Read file
Local fr := FileStream.Open("cerberus://internal/test2.txt","r")
'Local fr := FileStream.Open("cerberus://external/DCIM/Camera/test4.txt","r")
If fr <> Null
Print "File open to read"
Local s2:String = fr.ReadString()
fr.Close()
Print ("------------------")
Print ("s2="+s2)
Print ("------------------")
so = s2.Split("~n")
Print ("Count="+so.Length())
Else
Print "File not open to read"
Endif
Return 0
End
Method OnUpdate:Int()
Return 0
End
Method OnRender:Int()
canvas.Clear 0,0,0.5
canvas.SetColor 0.5,0.5,0.5
canvas.PushMatrix
canvas.Translate DeviceWidth()/2,DeviceHeight()/2
canvas.Scale 2.0,2.0
canvas.DrawText( String("Cerberus X~nHello World!").Split("~n")),DeviceWidth()/2,DeviceHeight()/2,0.5,0.5
For Local y:Int = 1 To so.Length()
canvas.DrawText so[y-1], 0, 0+y*20, .5, .5
Next
canvas.PopMatrix
canvas.Flush
Return 0
End
End
Strict
Import mojo2
Import brl
Import brl.FileSystem
Function Main:Int()
New myClass
Return 0
End
Class myClass Extends App
Field so:String[], canvas:Canvas, bg:Image
Method OnCreate:Int()
SetUpdateRate 0
canvas = New Canvas
' Write file
Local s:String
s = "brian~nJohn~nPeter"
Local fw:= FileStream.Open("cerberus://internal/test2.txt","w")
'Local fw:= FileStream.Open("cerberus://external/DCIM/Camera/test4.txt","w")
If fw <> Null
Print "File open to write"
fw.WriteString(s)
fw.Close()
Else
Print "File not open to write"
Endif
' Read file
Local fr := FileStream.Open("cerberus://internal/test2.txt","r")
'Local fr := FileStream.Open("cerberus://external/DCIM/Camera/test4.txt","r")
If fr <> Null
Print "File open to read"
Local s2:String = fr.ReadString()
fr.Close()
Print ("------------------")
Print ("s2="+s2)
Print ("------------------")
so = s2.Split("~n")
Print ("Count="+so.Length())
Else
Print "File not open to read"
Endif
Return 0
End
Method OnUpdate:Int()
If MouseDown(0)
Local y:=0
For Local f:=Eachin LoadDir( "cerberus://internal/",True )
Local p:=""+f
Local nm:=(f+" ")[..20]
Local ty:=""
If FileType( p )=FILETYPE_FILE
ty=FileSize( p )
Else
ty="(dir)"
Endif
Print nm+ty
Next
Endif
Return 0
End
Method OnRender:Int()
canvas.Clear 0,0,0.5
canvas.SetColor 0.5,0.5,0.5
canvas.PushMatrix
canvas.Translate DeviceWidth()/2,DeviceHeight()/2
canvas.Scale 2.0,2.0
canvas.DrawText( String("Cerberus X~nHello World!").Split("~n")),DeviceWidth()/2,DeviceHeight()/2,0.5,0.5
For Local y:Int = 1 To so.Length()
canvas.DrawText so[y-1], 0, 0+y*20, .5, .5
Next
canvas.PopMatrix
canvas.Flush
Return 0
End
End