Prevent the FD from using the zero value

Share your advanced PureBasic knowledge/code with the community.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Prevent the FD from using the zero value

Post by Marc56us »

I have been using the FD for years and sometimes I have problems with fonts (a font does not change) or images that are shifted (it is not the right image that is loaded in the first image)
I may review the code line by line, but I never found out why. I think there is a place where the system misuses the value zero :?:

Failing to find out where, I found a trick for: Prevent the FD from using the value zero for each of the enumeration types by using this value for another constant (even if not used)
:!: As the FD code cannot be modified, I create enumerations called before the IncludeFile of forms

Code: Select all

; Main Code

EnableExplicit

Enumeration FormWindow
    #Void
EndEnumeration

Enumeration FormGadget
    #Void
EndEnumeration

Enumeration FormMenu
    #Void
EndEnumeration

Enumeration FormImage
    #Void
EndEnumeration

Enumeration FormFont
    #Void
EndEnumeration

; And then call forms

XIncludeFile "..... .pbf"
XIncludeFile "..... .pbf"
XIncludeFile "..... .pbf"
And it works.

:wink: