Author Topic: Scope of include files ?  (Read 1367 times)

K_F

  • Member
  • *****
  • Posts: 1278
  • Anybody out there?
Scope of include files ?
« on: March 15, 2016, 12:51:51 AM »
Hi Ramon..
Just curious about the scope of the projects include files. - Are the include files visible to all modules and windows ?
Asking as when I move my data variables ect.. into a 'private' include file which is in the include section of the project explorer, the assembler throws what seems visibility errors.

There's also another problem of accessing structure variables across modules
- I set a structure variable to TRUE (1).
- Pass a pointer of the structure to another modules procedure.
- This procedure accesses the structure variable (via ASSUME statement) and get a FALSE (0) result ?
This project assembles with no errors

Still playing with EC1.... converting the project to EC2 is a problem at the moment.
I think EC2 is assuming 32bit projects to be 64bit when importing, as I cannot see this info in the project properties.

Also wondering what the effect would be if I place Include statements in each module, or just the projects main include file.

Thanks for any input
Van
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

dedndave

  • Member
  • *****
  • Posts: 8732
  • Still using Abacus 2.0
    • DednDave
Re: Scope of include files ?
« Reply #1 on: March 15, 2016, 09:37:37 AM »
if you assemble several modules, then add them to a library....

create a common INC, then include it in all the module sources

generally...

an INC file is essentially a series of added text
if i have a source file, half-way down...

Code: [Select]
include somefile.inc
it's as though all the text in the INC file were pasted into the source at that location

K_F

  • Member
  • *****
  • Posts: 1278
  • Anybody out there?
Re: Scope of include files ?
« Reply #2 on: March 15, 2016, 06:21:20 PM »
Ja. I'm busy doing this at the moment..
Just organising it into a structured way is taking more time  :icon_exclaim:

I was at a 'milestone' in this development.. only to be cut short... frustration!! ;)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

K_F

  • Member
  • *****
  • Posts: 1278
  • Anybody out there?
Re: Scope of include files ?
« Reply #3 on: March 15, 2016, 11:22:07 PM »
OK, resolved the scope problem... seems like EC1 and/or the assembler/linker doesn't work well with multiple custom INC files.
Dumped everything into one large INC file.

Now my GDI+ module has given up on me....... I'm going to cry in the corner  :icon_confused:
I might have to rewrite it.... waaaahhhh!!
 :biggrin:
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

dedndave

  • Member
  • *****
  • Posts: 8732
  • Still using Abacus 2.0
    • DednDave
Re: Scope of include files ?
« Reply #4 on: March 15, 2016, 11:30:53 PM »
the masm32 package is a fine example of several working library modules
\masm32\m32lib folder   :P

rsala

  • Moderator
  • Member
  • *****
  • Posts: 234
    • Easy Code
Re: Scope of include files ?
« Reply #5 on: March 16, 2016, 04:50:08 AM »
Hi K_F,

First of all, sorry for all the inconveniences.

- An include file added to "Include" section of the project explorer should be visible to all windows/modules.
- When passing the address of a structure to another module procedure, the structure should be read "as is".
- In all my tests, converting a project to EC2 has been succesful.
- If you place include statements in a module, the included file will only be visible in that module.

So, I would be very grateful if you could send me a project firing the errors you report, so that I could see the problem and fix it. :t

Regards,

Ramon
EC coder

K_F

  • Member
  • *****
  • Posts: 1278
  • Anybody out there?
Re: Scope of include files ?
« Reply #6 on: March 16, 2016, 05:31:32 PM »
Not to worry Ramon..

I've already rearranged the code so much that it's not recognisable at the moment  :biggrin:
It's all working now except my GDI module, which I think is my fault...

I do need to clean it up a lot, so this is an opportunity.
If it persists I'll send the problem your way ! ;)

Thanks
Van
 :t


'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

rsala

  • Moderator
  • Member
  • *****
  • Posts: 234
    • Easy Code
Re: Scope of include files ?
« Reply #7 on: March 17, 2016, 07:26:51 AM »
Ok Van, thank you!
 :t
EC coder