{ Analytica Model SF8345_add_item_to_i, encoding="UTF-8" } SoftwareVersion 5.4.6 { System Variables with non-default values: } SampleSize := 1000 TypeChecking := 1 Checking := 1 SaveOptions := 2 SaveValues := 0 {!-50299|DiagramColor Model: 65535,65535,65535} {!-50299|DiagramColor Module: 65535,65535,65535} {!-50299|DiagramColor LinkModule: 65535,65535,65535} {!-50299|DiagramColor Library: 65535,65535,65535} {!-50299|DiagramColor LinkLibrary: 65535,65535,65535} {!-50299|DiagramColor Form: 65535,65535,65535} NodeInfo FormNode: 1,0,0,,0,0,,,,0,,,0 {!-50299|NodeColor Text: 62258,62258,62258} Attribute AcpStyles Model SF8345_add_item_to_i Description: Demonstrates a UI design pattern that can be used to add a new item to an index.~ ~ View the edit table for Project Parameter and notice the projects that are there currently.~ Type a new project name in the text box on the diagram and press the + button.~ Notice that the project gets added to the Project index. Author: Dale Rice~ Lumina Decision Systems Date: Mon, Jun 7, 2021 9:02 AM DiagState: 2,0,0,1264,501,17 WindState: 2,955,454,720,350 FontStyle: Arial,15 FileInfo: 0,Model SF8345_add_item_to_i,2,2,0,0,C:\Temp\add item to index.ana Decision Enter_a_new_project_ Title: Enter a new project name: Definition: '' NodeLocation: 152,72,1 NodeSize: 64,24 WindState: 2,289,492,720,350 Aliases: FormNode Fo107036291 {!40700|Att_CellFormat: CellEntry(0,0,1)} FormNode Fo107036291 Title: Enter a new project name: Definition: 0 NodeLocation: 292,216,1 NodeSize: 228,16 NodeInfo: 1,,,,,,,248,,,,,,0 Original: Enter_a_new_project_ Index Project Title: Project Description: A list of projects. If you add a user input node for this index, then the user in browse mode can add projects directly from the edit table. Here I have not done so, so to add a project from browse mode you have to use the UI -- i.e., enter the project name and press the + button. Definition: ['Tessalator','Legbeater'] NodeLocation: 760,72,1 NodeSize: 64,24 WindState: 2,775,498,720,350 Att_PrevIndexValue: ['Tessalator','Legbeater'] Variable Project_parameter Title: Project parameter Description: A table that would hold a parameter or parameters for each project. Definition: Table(Project)(15,11) NodeLocation: 920,72,1 NodeSize: 64,24 WindState: 2,814,468,720,350 DefnState: 2,1341,135,416,303,0,DFNM Aliases: FormNode Fo761347715 ReformDef: [Undefined,Project] FormNode Fo761347715 Title: Project parameter Definition: 0 NodeLocation: 176,336,1 NodeSize: 112,16 Original: Project_parameter Button Add_new_project Title: + Description: Click this button to add the new project name to the Project index. NodeLocation: 540,220,1 NodeSize: 28,28 NodeInfo: 1,,,,0,0,1 WindState: 2,279,518,720,350 NodeFont: Arial,51 NodeFontColor: 1,32767,52427 OnClick: if Enter_a_new_project_='' then Error("Enter a project name")~ else if @[Project=Enter_a_new_project_] then Error(Enter_a_new_project_ & " is already in the Project index")~ else Project := Concat(Project,Enter_a_new_project_);~ ~ Enter_a_new_project_ := ''; { clear it to be ready for next entry }~ ShowWindow( Project_parameter, 'Definition') Close SF8345_add_item_to_i