{"name":"createDiaryLink","operator":null,"title":"createDiaryLink","type":"command","url":"https://community.bistudio.com/wiki/createDiaryLink","revid":325179,"updated":"2022-07-01T14:35:13Z","groups":["Briefing"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Creates a link to the given diary entry.","syntaxes":[{"syntax":"createDiaryLink [subject, record, text]","since":null,"effect":null,"exec":null,"params":[{"name":"subject","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"subject: String"},{"name":"record","type":"Object, Task or Diary Record","optional":false,"default":null,"description":null,"types":["Object","Task","Diary Record"],"since":null,"text":"record: Object, Task or Diary Record"},{"name":"text","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"text: String"}],"returns":{"type":"String","types":["String"],"description":"empty string or a string similar to the result of `format [\"<log subject=\"\"%1\"\" record=\"\"%2\"\">%3</log>\", subject, processedRecordId, text]`","text":"String - empty string or a string similar to the result of `format [\"<log subject=\"\"%1\"\" record=\"\"%2\"\">%3</log>\", subject, processedRecordId, text]`"},"form":"unary","operator":null,"left":null,"right":{"text":"[subject, record, text]","types":["Array"]}}],"examples":[{"text":"```sqf\n_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\"]]];\n```","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]];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["processDiaryLink","createDiaryRecord","createDiarySubject","diarySubjectExists","setDiaryRecordText"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Briefing","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}