Page 1 of 1

XIncludeFile in a module

Posted: Sun Aug 18, 2013 10:18 am
by Nero
Hiho,

If you include a file with XIncludeFile in your main source and then try to do the same in a modul it wont work.

test.pbi

Code: Select all

Structure Test
  a.l
EndStructure
test.pb

Code: Select all

XIncludeFile "./test.pbi"

abc.Test 

DeclareModule MyModul
  XIncludeFile "./test.pbi"
EndDeclareModule

Module MyModul
  defg.Test  
EndModule
But shouldn't this work because the modul is a seperated code block?

Mfg Nero

Re: XIncludeFile in a module

Posted: Sun Aug 18, 2013 10:23 am
by Fred
No, XIncludeFile ensures you include your file once and only once in the whole source. If you need your module to include this file always, just use IncludeFile.

Re: XIncludeFile in a module

Posted: Sun Aug 18, 2013 10:34 am
by Nero
Fred wrote:No, XIncludeFile ensures you include your file once and only once in the whole source.
Ah thanks for the info. I just thought it should work because the module is seperated from the other code :oops: