I hope you will find the following code useful, BUT it has not really been tested (other than bits and pieces). I would greatly appreciate it if someone would check it out to see if it has any bugs.
Here’s what it does: After you tell it what directory to work with, it takes all files with the older Real Studio file extensions (".rbp" and “.xml”) and replaces those extensions with the newer Xojo extensions (".xojo_binary_project" and “.xojo_xml_project”).
Here’s the code:
Dim dlg As SelectFolderDialog
Dim f As FolderItem
Dim I As Integer, Pos1
Dim FilenameWithoutExtension As String
Dim OldExtension, OldFilename As String
Dim NewExtension, NewFilename As String
dlg = New SelectFolderDialog
f = dlg.ShowModal
If f <> Nil Then
For I = 1 To f.Count
OldFilename = f.Item(i).Name
Pos1 = InStr (OldFilename, "." )
If Pos1 <> 0 Then
FilenameWithoutExtension = Left ( OldFilename, Pos1 - 1)
OldExtension = Mid (OldFilename, Pos1)
If OldExtension = ".xojo_binary_project" Then
NewExtension = ".rbp"
Elseif OldExtension = ".xojo_xml_project" Then
NewExtension = ".xml"
End If
If NewExtension = ".rbp" Or NewExtension = ".xml" Then
NewFilename = FIlenameWithoutExtension + NewExtension
f.Item(i).Name = NewFilename
If f.LastErrorCode > 0 then
MsgBox Str("Error: " + Str ( f.LastErrorCode) )
End if
End If
End If
Next I
End If
It you want the process to go in the other direction, just modify these lines accordingly:
If OldExtension = ".xojo_binary_project" Then
NewExtension = ".rbp"
Elseif OldExtension = ".xojo_xml_project" Then
NewExtension = ".xml"
End If
Enjoy (AFTER someone has checked it out)!
Barry Traver