Okay, I'm very new to PureBasic.
I'm trying to learn Visual Designer, which is incredible. I created a project called AWS (for Atomic Web Server, which I'm playing with). I specified AWS.PB as the main file and COMMON.PB as the include file. I then designed a screen with a ListView Gadget, with the idea that I would be able to create a status screen to see what people are requesting, etc.
I did a Generate Source and Visual Designer created the two files, which I used the PB editor to open. I started adding the Atomic Web Server.pb code which came in the sample code directory to the AWS.PB file which the Visual Designer created.
But then I decided to make some changes to the screen and went back into Visual Designer and added a button. I did a "Generate Source" and was asked if I wanted to overwrite my current source (which I backed up just in case). I said sure and sure enough, it didn't just create a new COMMON.PB but also created a new (single line) AWS.PB. No big deal, like I said, I expected it would do this and backed-up my work beforehand.
I'm wondering what the workflow is here. Do people normally not specify a main file in the project settings and just create one themselves? Or do you normally create a third file with all your actual code in it? I want to get a handle on this now, so I don't erase substantial work by using Visual Designer in the future.
Thanks,
Phil
Visual Designer/Generate Source overwrites previous work?
hmmm... well.. when i make a project i generally only use visual designer once, then if i want to make changes i do them manually...
i have re-made windows completely a few times with VD though, and i just saved the code with a different filename, then copy-pasted the code into my main program file.
the only reason i use more than one file for a project is so that i don't have to scroll so much to tweak my procedures, with all of my procedures in an include file, i can just click the tabs at the top to switch between them, which i find to be VERY usefull.
anyhow, welcome to purebasic!
i have re-made windows completely a few times with VD though, and i just saved the code with a different filename, then copy-pasted the code into my main program file.
the only reason i use more than one file for a project is so that i don't have to scroll so much to tweak my procedures, with all of my procedures in an include file, i can just click the tabs at the top to switch between them, which i find to be VERY usefull.
anyhow, welcome to purebasic!
--Aszid--
Making crazy people sane, starting tomorrow.
Making crazy people sane, starting tomorrow.
- Fangbeast
- PureBasic Protozoa

- Posts: 4792
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
Include files
The 2 files that Visual Designer creates are usually the main one that you would think would not be overwritten (but is) and the common one that isn't) containing all the code to create the form.
The first file contains a reference (IncludeFile) to always load the "Common.pb" to create the form.
When you start a project, always have one main file that contains your own program code. Include at the top of your code an "IncludeFile "common.pb"" to always load your form code.
It would be a good idea to save your Visual designer forms with something other than "Common" if you have more than one Visual Designer project.
Once you remember which of your project files belong to which project, you can always re-edit your form for that project and re-export the form, leaving the main code intact.
You NEVER, ever have to edit the form manually.
The first file contains a reference (IncludeFile) to always load the "Common.pb" to create the form.
When you start a project, always have one main file that contains your own program code. Include at the top of your code an "IncludeFile "common.pb"" to always load your form code.
It would be a good idea to save your Visual designer forms with something other than "Common" if you have more than one Visual Designer project.
Once you remember which of your project files belong to which project, you can always re-edit your form for that project and re-export the form, leaving the main code intact.
You NEVER, ever have to edit the form manually.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
i use a "dummy" file that ends up being written
with the include common.pb
that way the dummy is always the same name
and my "real" main is never overwritten.
I was confused about the way it worked at first,
but when I figured out this work-around; it is
easy to keep track of things and not lose
anything important (I do backup also, besides
renaming each minor revision)
Just comments from an amateur!
Joe
p.s. THANKS for the excellent tool!
with the include common.pb
that way the dummy is always the same name
and my "real" main is never overwritten.
I was confused about the way it worked at first,
but when I figured out this work-around; it is
easy to keep track of things and not lose
anything important (I do backup also, besides
renaming each minor revision)
Just comments from an amateur!
Joe
p.s. THANKS for the excellent tool!
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
