Hi
Version: Hotdocs Classic
I have two repeat dialogs which basically have the same variables. Call it:
dialogPartyNamePart1
dialogPartyNamePart2
I am currently working in dialogPartyNamePart2.
I get this error: Found a REPEAT instruction nested within another REPEAT instruction where the dialog (dialogPartyNamePart1) used in the inner REPEAT is not a child of the dialog used in the outer REPEAT.
I think I know why this is occurring. It's because I'm trying to get the data from an earlier entry and I do it via a REPEAT FILTER.
ie. My data for PartyName have been:
(a) Bob - likes Green
(b) Peter - likes Blue
(c) Andrew - likes Blue
Then my dialogPartyNamePart2 runs a computation which is:
doesSomeoneLikeGreenComputation:
REPEAT dialogPartyNamePart1
FILTER green
TRUE
END REPEAT
So Hotdocs does not like it when I'm trying to find out if someone likes Green this way.
I'm stuck. How do I look at previously entered data, to see if they like green, if I can't run a repeat on that data? Because it's always going to be a REPEAT to go through the previously entered data, and I need that data for another party, so I can auto set up their variables.
When trying to gain access to data found on Repeated dialogs within other unrelated dialogs it is necessary to use WHILE loop instructions instead of REPEAT loop instructions. This would likely have a local number variable (called index in the example below) and look something like:
SET index TO 1 WHILE ANSWERED(PartyName[index]) IF PartyName[index] CONTAINS "Green" TRUE END IF INCREMENT index END WHILE
Note: The above is an example of functional and correct code, however this code loops through the dialogPartyNamePart1 dialog and searches for any person who likes Green. If any person likes green it returns TRUE. You can replace the TRUE, with whatever other functionality you are trying to design. The reason for the example is that this code will run anywhere in HotDocs, repeated dialog or not.