Re: Do procedures really have to appear first?
Posted: Thu Aug 04, 2022 3:36 pm
And join the discord purebasic chat. See my signature for the link.
http://www.purebasic.com
https://www.purebasic.fr/english/
And join the discord purebasic chat. See my signature for the link.
That's fine, I've created a project and added my .PB and .PBF to it and a configuration file. The project tab is neat, with its ability to add any kinds of files. I notice the way in which you can right-click the upper Project Files box and add files, but you can't do the same with the lower Project Targets box. It's necessary to go into Compiler Options and do it through that.jacdelad wrote: Thu Aug 04, 2022 3:25 pm The project combines your sources and additional files plus additional info and settings into one file.
Try it, create a new project, give it a name. Then add a source file to the project. Now navigate to the project tab and set up all the settings for the project as you like (main source code, threadsafe, version info, which exe to create, icons...).
Yes, if you mean Visual Studio's incessant syntax error checking while you're typing and haven't completed making the changes you need, I agree there. There's been times when VS is trying to prevent me from making the very corrections that are needed to satisfy its own syntax checking!skywalk wrote: Thu Aug 04, 2022 5:01 pm I prefer to avoid syntax sugar like OOP or project related errors.
I only want to debug code and deploy my exe.
When you close the project, the project manager takes an MD5 fingerprint of all the files in the project. This is an integrity check to know if one of the sources has not been modified by another program (see *.pbp file, MD5 fingerprint line)Oso wrote: Thu Aug 04, 2022 6:02 pm One strange thing I notice is that after closing a project, it obviously writes something finally to the .PBP file (it updates the file's timestamp), which consequently means that when I open the project again (either by finding the .PBP file in Windows explorer and double-clicking it OR via Open Project in PB) it complains by showing the below. The file hasn't been modified by me, or by the O/S, but it has been modified on closure by the IDE. It seems wrong to say the file has changed, when it's the IDE that's changed it.
https://imgur.com/a/UOKEA9b
The only file that's changing is the .PBP and consequently its own MD5. None of the other project files change and neither do their individual MD5s. The warning message shows it's the .PBP that has the MD5 mismatch, not the project files, and I can see that the IDE is changing the timestamp in the .PBP file...Marc56us wrote: Thu Aug 04, 2022 8:25 pm When you close the project, the project manager takes an MD5 fingerprint of all the files in the project. This is an integrity check to know if one of the sources has not been modified by another program (see *.pbp file, MD5 fingerprint line)
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.00 LTS (Windows - x64)">
<section name="config">
<options closefiles="1" openmode="1" name="New Project"/>
</section>
<section name="data">
<explorer view="" pattern="0"/>
<log show="1"/>
<lastopen date="2022-08-04 19:07" user="admin" host="WINDOWS10PRO"/>
</section>
<section name="files">
<file name="config.txt">
<config load="0" scan="0" panel="1" warn="1" lastopen="0" panelstate="+"/>
<fingerprint md5="098f6bcd4621d373cade4e832627b4f6"/>
</file>
<file name="console.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" panelstate="+"/>
<fingerprint md5="5fc4472644577180c958deb49280267a"/>
</file>
<file name="new_test.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" panelstate="+"/>
<fingerprint md5="e694124c8295ee3ea2e9c7a4839c24a5"/>
</file>
<file name="new_test.pbf">
<config load="0" scan="1" panel="1" warn="1" lastopen="0" panelstate="+"/>
<fingerprint md5="b4dc0737af1a674658eca8f008b3eb03"/>
</file>
<file name="new_test.pbp">
<config load="0" scan="0" panel="1" warn="1" lastopen="0" panelstate="+"/>
<fingerprint md5="df1513e9cb8db1670cf8c63e5dec11a9"/>
</file>
</section>
<section name="targets">
<target name="Default Target" enabled="1" default="1">
<inputfile value="new_test.pb"/>
<outputfile value="new_test.exe"/>
<compiler version="PureBasic 6.00 LTS (Windows - x64)"/>
<executable value="new_test.exe"/>
<options xpskin="1" dpiaware="1" debug="1" optimizer="0"/>
</target>
<target name="console" enabled="1" default="0">
<inputfile value="console.pb"/>
<outputfile value="console.exe"/>
<compiler version="PureBasic 6.00 LTS (Windows - x64)"/>
<executable value="console.exe"/>
<options optimizer="0"/>
</target>
</section>
</project>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 6.00 LTS (Windows - x64)">
<section name="config">
<options closefiles="1" openmode="1" name="New Project"/>
</section>
<section name="data">
<explorer view="" pattern="0"/>
<log show="1"/>
<lastopen date="2022-08-04 21:32" user="admin" host="WINDOWS10PRO"/>
</section>
<section name="files">
<file name="config.txt">
<config load="0" scan="0" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="098f6bcd4621d373cade4e832627b4f6"/>
</file>
<file name="console.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="5fc4472644577180c958deb49280267a"/>
</file>
<file name="new_test.pb">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="e694124c8295ee3ea2e9c7a4839c24a5"/>
</file>
<file name="new_test.pbf">
<config load="0" scan="1" panel="1" warn="1" lastopen="1" panelstate="+"/>
<fingerprint md5="b4dc0737af1a674658eca8f008b3eb03"/>
</file>
<file name="new_test.pbp">
<config load="0" scan="0" panel="1" warn="1" lastopen="0" panelstate="+"/>
<fingerprint md5="33515d42ebfe3e7d81b672fbcabfbbd3"/>
</file>
</section>
<section name="targets">
<target name="Default Target" enabled="1" default="1">
<inputfile value="new_test.pb"/>
<outputfile value="new_test.exe"/>
<compiler version="PureBasic 6.00 LTS (Windows - x64)"/>
<executable value="new_test.exe"/>
<options xpskin="1" dpiaware="1" debug="1" optimizer="0"/>
</target>
<target name="console" enabled="1" default="0">
<inputfile value="console.pb"/>
<outputfile value="console.exe"/>
<compiler version="PureBasic 6.00 LTS (Windows - x64)"/>
<executable value="console.exe"/>
<options optimizer="0"/>
</target>
</section>
</project>
Code: Select all
Procedure.i myProc()
Code: Select all
procHead("myProc") = "Procedure.i myProc()"
*proc("myProc") = @myProc()
Procedure.i myProc()
Code: Select all
CallFunctionFast(*proc("myProc") )
Wasn't aware of these capabilities. Will check them out, thanksblueb wrote: Fri Aug 05, 2022 2:02 pm
With such things as quick methods to add code into my programs, such as:
- Starter templates
- Inject prefs file code
- add previously built Macros
- WinAPI code
- Special formatting, etc.
- Error fixes for various versions (Ascii fixes, etc.)
You have "<options openmode="1"/>". This is "load all sources of the project" in the Project Options dialog. The project file content therefore changes as soon as you open it because the IDE opens all of the files even if they weren't open the last time you closed the project and updates their status accordingly. This gets written back to the project file when you close it. There's nothing abnormal about this.Oso wrote: Thu Aug 04, 2022 9:54 pm The only file that's changing is the .PBP and consequently its own MD5.
Thanks for the reply Spikey, it's helpful to read what you say. All the replies give us newcomers to PB a leap in knowledge.spikey wrote: Sat Aug 06, 2022 11:36 amThis gets written back to the project file when you close it. There's nothing abnormal about this.
I'm not sure why you're getting the change notice though
Ah - that's what it is - took me a while to figure that out! You've got the project file itself in the project file list. The fingerprint of the project file gets calculated and stored in the project file but this changes the fingerprint of the project file so it doesn't match when it gets reopened and triggers the change notice...Oso wrote: Thu Aug 04, 2022 9:54 pm The only file that's changing is the .PBP and consequently its own MD5.
Yes, we both found the problem together. Thanks for looking at this though. I noticed that when I created a new project, adding each file one at a time, the warning message didn't return, so then I began to question what I'd done differently.spikey wrote: Sat Aug 06, 2022 8:04 pm The solution is to remove the PBP file from the list of project files, once you do that and close and reopen the project you should stop getting spurious notices. You don't need the PBP file in the list because it doesn't contain any code completion items.
Irrespective is one of my favorite underutilized words. It's like the grammatical version of fingernails on a chalkboard when someone uses "irregardless".irrespective of what has been created...