{"name":"createDiaryLink","title":"createDiaryLink","type":"command","url":"https://community.bistudio.com/wiki/createDiaryLink","revid":325179,"updated":"2022-07-01T14:35:13Z","groups":["Briefing"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Creates a link to the given diary entry.","syntaxes":[{"syntax":"createDiaryLink [subject, record, text]","params":[{"name":"subject","type":"String","type_expr":"String"},{"name":"record","type":"Object, Task or Diary Record","type_expr":"Object | Task | Diary Record"},{"name":"text","type":"String","type_expr":"String"}],"returns":{"type":"String","type_expr":"String","description":"empty string or a string similar to the result of `format [\"<log subject=\"\"%1\"\" record=\"\"%2\"\">%3</log>\", subject, processedRecordId, text]`"},"form":"unary","right":{"text":"[subject, record, text]"}}],"examples":[{"code":["_diaryRec1 = player createDiaryRecord [\"Diary\", [\"Record 1\", \"We can not refer to the next record because it does not exist yet.\"]];\n_diaryRec2 = player createDiaryRecord [\"Diary\", [\"Record 2\", \"Go to \" + createDiaryLink [\"Diary\", _diaryRec1, \"record 1\"]]];\n_diaryRec3 = player createDiaryRecord [\"Diary\", [\"Record 3\", \"Go to \" + createDiaryLink [\"Diary\", _diaryRec2, \"record 2\"]]];"]},{"text":"In this example, one can go to any next record.\n\n```sqf\nTAG_fnc_processDiaryLink = {\n    processDiaryLink createDiaryLink [\"Diary\", _this, \"\"];\n};\nDiaryRec1 = player createDiaryRecord [\"Diary\", [\"Record 1\",\n    \"Go to <execute expression='DiaryRec2 call TAG_fnc_processDiaryLink'>Record 2</execute>\"\n]];\nDiaryRec2 = player createDiaryRecord [\"Diary\", [\"Record 2\",\n    \"Go to <execute expression='DiaryRec3 call TAG_fnc_processDiaryLink'>Record 3</execute>\"\n]];\nDiaryRec3 = player createDiaryRecord [\"Diary\", [\"Record 3\",\n    \"Go to <execute expression='DiaryRec1 call TAG_fnc_processDiaryLink'>Record 1</execute>\"\n]];\n```","code":["TAG_fnc_processDiaryLink = {\n\tprocessDiaryLink createDiaryLink [\"Diary\", _this, \"\"];\n};\nDiaryRec1 = player createDiaryRecord [\"Diary\", [\"Record 1\", \n\t\"Go to <execute expression='DiaryRec2 call TAG_fnc_processDiaryLink'>Record 2</execute>\"\n]];\nDiaryRec2 = player createDiaryRecord [\"Diary\", [\"Record 2\", \n\t\"Go to <execute expression='DiaryRec3 call TAG_fnc_processDiaryLink'>Record 3</execute>\"\n]];\nDiaryRec3 = player createDiaryRecord [\"Diary\", [\"Record 3\", \n\t\"Go to <execute expression='DiaryRec1 call TAG_fnc_processDiaryLink'>Record 1</execute>\"\n]];"]}],"see_also":["processDiaryLink","createDiaryRecord","createDiarySubject","diarySubjectExists","setDiaryRecordText"]}