Page 1 of 1

CVS ?, residents ?

Posted: Wed Oct 08, 2003 9:32 am
by Psychophanta
I know waht mean Interfaces in PB, but please:
What mean CVS? and residents?

Posted: Wed Oct 08, 2003 9:53 am
by helpy
CVS = Concurrent Versions System (more info on www.cvshome.org)

Residents (folder .\PureBasic\Residents) contain (in compiled form) definitions like constants, structures and interfaces.

cu, helpy

Posted: Wed Oct 08, 2003 4:27 pm
by Psychophanta
Thanx, helpy. :)

Posted: Thu Feb 26, 2004 4:01 am
by Dare2
Hi all,

I have read what I can find on Residents and still don't really understand the why and wherefor of them.

Could somebody explain (in a simple way understandable by a simple mind) what these do, their benefits and etc.

And a maybe-maybeNot-related Q - Do libraries have an industry standard format. For eg, could a PB library work with masm, or vice versa?

Thanks.

Posted: Thu Feb 26, 2004 1:38 pm
by freak
This is a PB specific thing. A .res file (found in the Residents folder of PB)
contains definitions of constants, structures or interfaces. The compiler reads
those, and automatically knows all the structures/constants/interfaces, that
are in there, without the need to write them in your code.
Kind of like a C header file that always get's included.

For example, there is the PureBasic_x86.res . It contains all of PB's own
constants. Remove it, and it won't recognize any of the flags for the commands.
There is also one for the WinAPI stuff, and for win32 interfaces and DirectX interfaces.

You can create your own .res file, if you have often used constants for example,
that you don't want to type all the time.
Just create a normal .pb file with them, and run the commandline compiler
like this:

pbcompiler.exe source.pb /RESIDENT residentfile.res

then, move the created .res file to the residents folder, restart PB, and
the compiler should know all your stuff.


About the libraries:
The files follow no standart. You can only use them with PB.

If you have a library in *.obj or *.lib format, you can turn it into a PB
library with the LibraryMaker tool (in LibrarySDK folder), but only if it's
functions are named properly (PB_ prefix for the functions). See the
LibrarySDK for more details.

Timo

Posted: Thu Feb 26, 2004 1:54 pm
by Dare2
Okay, I think maybe the penny has dropped. (Finally :))

Thank you, I really appreciate that. :)

Posted: Sun Jul 25, 2004 1:53 pm
by PB
> pbcompiler.exe source.pb /RESIDENT residentfile.res

Hmm, I tried to create a resident file with #MB_SETFOREGROUND but the
compiler complains that this constant is unknown... but the following works:

Code: Select all

Debug #MB_SETFOREGROUND ; Returns 65536
How can compiling an app with it work, yet creating a residents file doesn't?
I've been using this constant in all my apps like the following, but I'd prefer
it to be a resident: #MB_SHOW=#MB_SETFOREGROUND|#MB_TASKMODAL

Posted: Sun Jul 25, 2004 2:08 pm
by freak
When creating a resident file, the compiler doesn't load any other resident files,
so it doesn't know the value of that constant.

You must put the constant value as a number there.

Timo

Posted: Sun Jul 25, 2004 2:19 pm
by PB
Thanks Freak, it works now. :)