Page 1 of 2

Move project to new pc

Posted: Friday 24th June 2022 2:27pm
by Ham13
Hello,
I have a large project created on a pc running Linux Mint 20. Gambas 3.17 is running on that PC. I copied the whole project directory to a CD using Brassero. I copied this directory to a VirtualBox VM. I'm running Linux Mint 20.3 and Gambas 3.17.2 on the VM. When I check the copied directory there are over 400 files listed. When I open the directory only 3 are visible. When I try to load the project from the open project window; I click on the project. The project is not highlighted and will not load. Nothing is seen in the project files window. I know that Gambas works because I have made executables of other projects.

How can I transfer this project over to the VM. It should be possible. All answers are appreciated.

Thanks!

Marty

Re: Move project to new pc

Posted: Friday 24th June 2022 2:46pm
by cogier
Welcome to the forum.

It sounds like you have not copied the 'hidden' files. I suggest you make a Source Archive:-
Image

Copy this file to your VM folder, then in Gambas File > Open project...
Right-click on the archive and select Uncompress file
Gambas will then jump straight to the new folder.

Image

Re: Move project to new pc

Posted: Friday 24th June 2022 5:50pm
by Ham13
Cogier,

Thank you for the response. Your suggestion appears to be correct. Made a source archive and loaded it. First I did not see any thing other then the Gambas background. Did a compile All and now I can see the files.

however I now see files named like this:
modMain.module(1)
modMain.Module(2)
ModMain.module(3)
modMain.module~(1)
modMain.Module~(2)
modMain.Module~(3)

modMain is a valid module name but, I think there was only one in the original project. What are they and should I do do anything with them?

Thanks,
Marty

Re: Move project to new pc

Posted: Saturday 25th June 2022 2:32pm
by cogier
The files : -

modMain.module~(1)
modMain.Module~(2)
modMain.Module~(3)

The easy way is from Gambas use Project > Cleanup as I think these are just backup files, if they are this method will remove them.

Without seeing the whole program, I am unable to advise on the others.

Re: Move project to new pc

Posted: Sunday 26th June 2022 7:41pm
by Ham13
Cogier,

Tried to clean backup but the extra files were not removed. Each appears to be text file containing a class definition associated with a form. I added a short example below. For some reason I can not attach a text file so I had to cut and paste. This will give you an idea of what is contained in the files. All of the files under a form appear to be the same.

Gambas class file

Private Const Advanced_Height As Integer = 539
Private Const Basic_Height As Integer = 220
Private Const Form_Width As Integer = 651
Private Const Advanced_Cmd As String = "Add Director"
Private Const Basic_Cmd As String = "Current Directors"
Private flgAdvanced As Boolean = False

Public Sub Form_Open()

DataView1.View.Columns.Width = -1

Directors.Connection = modMain.$Con
Directors.Table = "tbldirectors"
Directors.Sort = "Director"
Directors.MoveFirst

Me.Caption = "Officers"
Me.Height = Basic_Height

Me.DataCombo1.Table = "tbllocation"
Me.DataCombo1.Display = "Location"
Me.DataCombo1.Field = "Locator"

Me.DataCombo2.Table = "tblofficers"
Me.DataCombo2.Display = "Position"
Me.DataCombo2.Field = "Office"

Me.Height = Basic_Height
lblAdvanced.Text = Advanced_Cmd
lblAdvanced.Foreground = modMain.Red
lblAdvanced.Visible = False

btnAdd.Visible = False
btnDelete.Visible = False
btnSave.Visible = False
btnCancel.Visible = False
modMain.Lock_Controls(frmDirectors)

End

Public Sub btnClose_Click()

Dim intResult As Integer

intResult = Message.Question("Closing", "OK", "Cancel")
If intResult = 1 Then
If modMain.flgAdd Or modMain.flgDirty Then
btnSave_Click()
Endif
Endif
Me.Close

End

Public Sub btnCancel_Click()

Dim intResult As Integer

intResult = Message.Question("Cancel", "OK", "No")

If intResult = 1 Then
If modMain.flgEdit Then
'modData.Read_Buffer(frmDirectors)
Directors.Cancel
Endif
modMain.flgEdit = False
modMain.flgAdd = False
modMain.flgDirty = False
btnAdd.Visible = False
btnDelete.Visible = False
btnSave.Visible = False
btnCancel.Visible = False

Hope this helps.

Marty

Re: Move project to new pc

Posted: Sunday 26th June 2022 8:44pm
by BruceSteers
cd /project/folder
rm -f ".src/*~*"
rm -f ".src/*(*"
or press Ctrl-h to show all files in your file browser and find the files to delete

the files with ~ are backup files, just copies of the original ones.
the files with (1) etc are because you have repeatedly copied files when they already existed..

the above commands from the source dir should clear your backup/copies

Re: Move project to new pc

Posted: Monday 27th June 2022 2:19pm
by BruceSteers
You probably need to know this.....

By default when dragging files/folders most file managers like caja, dolphin, nautilus will not copy hidden or backup files unless you have selected to show the files first.

Any file/folder that begins with a dot like .src .gambas etc are "hidden"
Any file that ends with a tilde~ is a backup file.

Brassero may have a "Show hidden files" option or if you drag-dropped from desktop then show hidden files first (or make an archive).

Most file managers use Ctrl-h to show/hide hidden files.
Caja (MATE desktop file manager) uses Ctrl-h to show hidden files and Ctrl-k to show backup files but also those options are in the "View" menu.

PS.
If you right click a project folder and select "Compress" to make an archive most archivers WILL include hidden files regardless of the view.

THE most important files of your project are the .project file and the .src directory (both are hidden)

Re: Move project to new pc

Posted: Tuesday 28th June 2022 7:15pm
by Ham13
Thank you all for your input! I have almost got the project back on track. I do have one other problem that shows up when I run the project. There is a library that the project cannot find. When I run the project it tells me that it cannot find the library. I checked the libraries and there is a library that the project cannot find. Maybe from a previous iteration. Tried to remove it using the project properties - library - remove but, it will not remove it. Is there there way I can remove this library or work around it? If I can get rid of it I can move on to debuging the project.

Regards,
Marty

Re: Move project to new pc

Posted: Tuesday 28th June 2022 9:59pm
by BruceSteers
If you copied folder to a cd then copied to disk you may need to set write properties as cd files are read only so all files in project folder may also now be read only.

chmod -R +w /project/dir/*

Can't think of any other reason you can't remove a library?

Re: Move project to new pc

Posted: Thursday 30th June 2022 11:28am
by BruceSteers
ps , the easiest way for us to help debug a program for you is if you posted it here then we could take a look for you :)