Was doing a web search for a caps lock util and found this site:
http://www.georgejopling.co.uk/capslock/capslock.html
He says the apps are written in PureBasic! A pleasant surprise.
So George, if you're here: say hi to us! Good to see PureBasic
promoted on your website.
Is George Jopling here?
Is George Jopling here?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: Is George Jopling here?
Hi PB,PB wrote:Was doing a web search for a caps lock util and found this site:
http://www.georgejopling.co.uk/capslock/capslock.html
He says the apps are written in PureBasic!
I downloaded the source code and tried to compile it. Note latest version stated in file is PB 4.20
I get an error "Structure KBDLLHOOKSTRUCT already declared in a resident file" from this code:
Code: Select all
Structure KBDLLHOOKSTRUCT
vkCode.l
scanCode.l
flags.l
time.l
dwExtraInfo.l
EndStructure original:
Code: Select all
DataSection
Beep: IncludeBinary "beep.wav"
redcross: IncludeBinary "redcross.ico"
greentick: IncludeBinary "greentick.ico"
EndDataSection Code: Select all
DataSection
Beep:
IncludeBinary "beep.wav"
redcross:
IncludeBinary "redcross.ico"
greentick:
IncludeBinary "greentick.ico"
EndDataSection Neil
Re: Is George Jopling here?
No, but labels must be followed by a ":" like any other statement when on a line with multiple statements, it was a bug before.Neil wrote: Also, has the required format for Data definitions changed ?
The change originated from here -> http://www.purebasic.fr/english/viewtop ... 28&t=55874
"Have you tried turning it off and on again ?"
Re: Is George Jopling here?
Hi Luis,luis wrote:No, but labels must be followed by a ":" like any other statement when on a line with multiple statements, it was a bug before.Neil wrote: Also, has the required format for Data definitions changed ?
The change originated from here -> http://www.purebasic.fr/english/viewtop ... 28&t=55874
Thanks for info.
Any thoughts on the "Structure defined" bug ??
Cheers,
Neil
Re: Is George Jopling here?
As the error message indicates, it is defined elsewhere. Comment it out, and the code works after you add another colon to the labels.Neil wrote:
Any thoughts on the "Structure defined" bug ??
Cheers,
Neil
Re: Is George Jopling here?
It's not a bug: it just means the structure is now predefined in the residents.
Open Tools -> Structure Viewer and look for "KBDLLHOOKSTRUCT".
You can just comment out the declaration in the source and it should work.
Open Tools -> Structure Viewer and look for "KBDLLHOOKSTRUCT".
You can just comment out the declaration in the source and it should work.
"Have you tried turning it off and on again ?"
Re: Is George Jopling here?
Hi Luis,
Anyway, what are the "residents" ??
So why would he have included this definition in the code ??
The "key count" sound does not sound and I was wondering if this was the cause.
Thanks,
Neil
Yes sorry - I shouldn't have referred to it as a "bug" - which would imply an error in PB.luis wrote:It's not a bug: it just means the structure is now predefined in the residents..
Anyway, what are the "residents" ??
Yes - the structure shown in the viewer is the same as in the code.luis wrote:Open Tools -> Structure Viewer and look for "KBDLLHOOKSTRUCT".
So why would he have included this definition in the code ??
Yes I had done this and program compiled ok.luis wrote:You can just comment out the declaration in the source and it should work.
The "key count" sound does not sound and I was wondering if this was the cause.
Thanks,
Neil
Re: Is George Jopling here?
It's explained in the manual, now: http://www.purebasic.fr/english/viewtop ... 77#p369177Neil wrote: Anyway, what are the "residents" ??
Thanks for the addition, BTW
And here it is what the manual says:
HELP wrote: Residents are precompiled files which are loaded when the compiler starts. They can be found in the 'residents' folder of the PureBasic installation path. A resident file must have the extension '.res' and can contain the following items: structures, interfaces, macros and constants. It can not contain dynamic code or procedures.
When a resident is loaded, all its content is available for the program being compiled. That's why all built-in constants like #PB_Event_CloseWindow are available, they are in the 'PureBasic.res' file. All the API structures and constants are also in a resident file. Using residents is a good way to store the common macros, structure and constants so they will be available for every programs. When distributing an user library, it's also a nice solution to provide the needed constants and structures, as PureBasic does.
To create a new resident, the command-line compiler needs to be used, as there is no option to do it from the IDE. It is often needed to use /IGNORERESIDENT and /CREATERESIDENT at the same time to avoid duplicate errors, as the previous version of the resident is loaded before creating the new one.
Residents greatly help to have a faster compilation and compiler start, as all the information is stored in binary format. It is much faster to load than parsing an include file at every compilation
Evidently at the time the structure was not yet been added in the residents and he had to declare it by himself.Neil wrote: So why would he have included this definition in the code ??
"Have you tried turning it off and on again ?"
Re: Is George Jopling here?
Hi Luis,
Thanks again for detailed response - much appreciated.
I always learn something new from PB forum posts.
Cheers,
Neil
Thanks again for detailed response - much appreciated.
I always learn something new from PB forum posts.
Cheers,
Neil


