Recent

Author Topic: I have really messed up & everything is scrambled  (Read 334 times)

CarmichaelJohn

  • New Member
  • *
  • Posts: 27
I have really messed up & everything is scrambled
« on: September 15, 2020, 08:32:12 pm »
Hello,
Please excuse this basic question, but I am at a loss to discover what is happening.
A month or so ago I built a program that calls a subroutine just to learn how the calling functions work using what I thought I learned in the Lazarus Tutorial.  It ran fine.  Then this morning in attempting to port over a statistical distribution subroutine from Delphi XE, I built a Main calling program and a subroutine that was to contain the statistical distribution code.  I followed the same pattern that was successful a month ago.  However, this morning upon execution the main calling program does not show up but the subroutine with the statistical header does show up on the display. I had placed the new calling program and the statistical distribution subroutine in a new folder in the “C” directory while the learning program from a month ago was in a separate folder in the Documents/Lazarus Projects path. I gave up on the new calling program and not only deleted it but also deleted the entire folder on the “C” directory.  Now when I went back to the learning program, it tries to call the statistical distribution subroutine instead of the original to-be-called subroutine.  This has me totally baffled.  How to I clean up this mess that I have inadvertently made??

Thank you in advance,
John

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6622
  • Debugger - SynEdit - and more
    • wiki
Re: I have really messed up & everything is scrambled
« Reply #1 on: September 15, 2020, 08:44:24 pm »
The first question is how you got into it.

My guess: When you created the new project, you used "Save as", either for the project, or some of its units.
But "save as" can create links to the old/new folder, and the project then gets split. (In some cases, that is what people need, but it can screw things up).

First back up, all that you still have.
You may want to check, by default the IDE creates backup folders (in the project dir). Maybe there will be some of the data that you are missing. Use an external editor, so the IDE does not overwrite any backups.
Given that you deleted an entire folder, you may have deleted files that you needed. That may not be fixable.



To get new clean projects.

Either:
- Always use the menu: "project" > new project.
  Any files (only pas or pp) you want to copy, do copy them outside the IDE.
- If you want to base it on an existing project: Use "project" > "publish project". And publish to a new folder. Then open the project from the new folder.

Never, use the "path" options in "Project options" (in case you don't know them, thats ok)

CarmichaelJohn

  • New Member
  • *
  • Posts: 27
Re: I have really messed up & everything is scrambled
« Reply #2 on: September 15, 2020, 09:10:54 pm »
Martin
Thank you very much for your almost immediate reply and advice.  I think what I did wrong was from the start, I began by using the wrong "new" option, I used the "File-New-Package" sequence and went from there.  Now, when I try the "Project-Open Project" option (not under File and new, nothing happens no matter which folder I select. I will go back and reread the Lazarus Tutorial and try to do it correctly next time.  I think all of the code that I have already done is lost; the backup folders did not have anything except the Lazarus project information files. 
I really appreciate your help and before anyone spends more time on my question, I will go back and start over, hopefully more carefully this time.
Thank you again, John

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6622
  • Debugger - SynEdit - and more
    • wiki
Re: I have really messed up & everything is scrambled
« Reply #3 on: September 15, 2020, 09:45:39 pm »
A "package" is a selection of files (units), that you can include in projects (re-use for many projects).  At this time you probably do not want to create your own packages. 
(E.g. the LCL is a package, it has the code for forms and buttons, etc.)

A package does not create an executable.
BUT: when you open the IDE, it always opens a project.
- Either the last project you worked on
- Or an empty project, in the temp folder. Something like C:\Users\USERNAME\AppData\Local\Temp\

So when you created a package, the files in the package became part of a project (if you did not save that project, the it was saved in the temp folder, but may have been overwritten by now / there may be a backup folder in the temp folder too)

So the open project would have created the executable, using files from that package.

jamie

  • Hero Member
  • *****
  • Posts: 3538
Re: I have really messed up & everything is scrambled
« Reply #4 on: September 15, 2020, 10:49:33 pm »
I don't see the OS you are running but in windows you have a Recycle bin where files go to when you delete

Unless you have cleaned it out since this upset occurred it should be there.
The only true wisdom is knowing you know nothing

CarmichaelJohn

  • New Member
  • *
  • Posts: 27
Re: I have really messed up & everything is scrambled
« Reply #5 on: September 16, 2020, 11:57:00 pm »
Martin and Jamie,
Thank you both so much for taking the time to help.  I really appreciate your help, you're sharing your wisdom, and your kindness.
John

 

TinyPortal © 2005-2018