Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
@INCLUDE with variables
Answer
4/4/16 7:59 AM
Hello,

I want to use a GraphRep for multiple classes. So I add the complete GraphRep into "file.asc".
I add some global variables in the AppInitalized Event
 1CC "Core" GET_CLASS_ID classname:("__ModelTypeMetaData__")
 2  #--> RESULT ecode:intValue classid:intValue
 3
 4  SETL debug:("Yes")
 5  IF (debug = "Yes") {
 6    SETG skriptPath:("C:\\<my_path>\\")
 7  }
 8  ELSE {
 9    SETG skriptPath:("db:\\")
10  }
11  CC "Core" SET_ATTR_VAL objid:(classid) attrname:("Script path (source)") val:(skriptPath)

I tested:

doesn't work ("Script path" is a reference in __D-construct__ )
1GRAPHREP layer:-2 sizing:asymmetrical
2AVAL scriptPath:"Script path"
3@INCLUDE (scriptPath+"file.asc")

doesn't work
1GRAPHREP layer:-2 sizing:asymmetrical
2SET scriptName:"C:\\<my_path>\\file.asc"
3@INCLUDE (scriptName)

works - but this is useless
1GRAPHREP layer:-2 sizing:asymmetrical
2@INCLUDE ("C:\\<my_path>\\file.asc")

Is there any trick to fix this?

Edit:
The idea is to add a small pice of GraphRep at each child-classes. The main part is equal.

Greetings
Swante
Attachment

Attachments: Unbenannt.png (14.8k)

RE: @INCLUDE with variables
include graphrep database
Answer
12/11/17 10:41 AM as a reply to Swante.
„The idea is to add a small pice of GraphRep at each child-classes. The main part is equal. “

For the main part one could save the GraphRep code in a .leo file in the database. Than include the main part via @INCLUDE "db:\\MainPart_GraphRep.leo" in the GraphRep Attribute of each class. After the @INCLUDE statement one could add additional code in the child-classes.