Xem kết hợp Flat Xem Xem cây
Luồng thảo luận [ Trước | Tiếp theo ]
toggle
@INCLUDE with variables
Câu trả lời
07:59 04/04/2016
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
Đính kèm

Các đính kèm: Unbenannt.png (14,8k)

RE: @INCLUDE with variables
include graphrep database
Câu trả lời
10:41 11/12/2017 gửi bài phản hồi tới 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.