Hi there , sorry to bothers you guys , I have hard time trying to add an Include line INCLUDE(‘TKTOURNAMENT077.INC’),ONCE into a Source template I edit the form the solution explorer and inserted and it works but then it gets erase again , is probably something very simple. Couldn’t find any documentation regarding adding includes . I did add one into the global but no luck inside the template . thanks guys .
If you want to add code to generated modules you need to add it in an appropriate embed point, not in the CLW directly. If you add it to the CLW directly it will be overwritten by the next Generate.
So, view the procedure in the embeditor (ie seeing all the code) and add your include at an appropriate position.
If necessary there are MODULE embed points as well.
I went to add a new procedure and put a; the codes , now I need to add another Include since my code is calling for another procedure but I cant find where to add it
One thing to consider with your screenshot.
Unless the code in your file is not code that would normally be INSIDE the MAP statement, you might be using the wrong embed.
I’d expect it to be something like:
MODULE('SomeModuleName')
SomeProcedureName PROCEDURE() ... (other params here)
END
The code you are pointing to
map
include('tktournament070.inc')
end
is generated by the template ABModule.tpw.
Like @Bruce has said, its best to use one of the built in embeds available when using the AppGen Module view.
This embed looks like a suitable candidate
#EMBED(%ModuleDataSection,'Module Data Section'),DATA
something like
Map !your handcoded map structure because you can have more than one map structure.
include('path\to\myclassfile.inc') ! exclude the path if it can be found in your RED file.
End !End of my handcoded map structure
I’m assuming you only want your class to have the scope the module provides and not global scope?
For more info, see class_object_declaration_.htm [Clarion Community Help]
Scoping Issues
The scope of an object is dependent upon where it is declared. Generally, a declared object comes into scope at the CODE statement following its declaration and goes out of scope at the end of the related executable code section. A dynamically instantiated object (using NEW) shares the scope of the executable code section in which it is instantiated.
An Object declared:
·As Global data is in scope throughout the application.
·As Module data is in scope throughout the module.
·As Local data is in scope only in the procedure, except …
IMO this should read…
·As Module data is in scope throughout the module and procedures called from the module.
Note that you can have multiple MAP sections. You don’t have to have just the one
