Can I build variables within variables?

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
MDonoghue
Jr. Propeller Head
Posts: 4
Joined: Tue Jul 08, 2008 7:12 am

Can I build variables within variables?

Post by MDonoghue »

I mean, can you do something like the following example:

I have a food menu and choose chicken, can I see a list of those vegetables available with the chicken?
And if I choose potatoes can I choose gravy, butter, or nothing?

You get the idea...

Thanks - MD
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Can I build variables within variables?

Post by doc_guy »

Not really; what is the use case? How would it work in the help system?
Paul Pehrson
My Blog

Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Can I build variables within variables?

Post by LTinker68 »

You can't do it to that level, that is, not a variable inside a variable. But you can create a set of variables like meat, cornType, potatoType, etc., then in the target editor, override the variable values just for that target. So in the "chicken" target you'd set the meat variable to chicken, the cornType variable to corn-on-the-cob, and the potatoType to mashed. But in the "ribs" target you'd set the meat variable to ribs, the cornType to corn, and the potatoType to fries. When you build the "chicken" target, all of instances of the meat variable will show chicken, and so on.

This would require you to create a target for every possible combination, though, so it may not be exactly what you're looking for, although it might work in the short term. It really depends on how you're going to use it. If you're thinking of an instance where you want to give the end user a series of drop-down boxes on a web page and the type of help they see depends on what options they selected, then you're going to have to make targets for each of those possible combinations, and the drop-down boxes you'll have to set up manually. Theoretically you can have the drop-down boxes as part of the Flare project, but Flare isn't set up to create forms, so you'd have to manually enter the code.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Can I build variables within variables?

Post by NorthEast »

MDonoghue wrote:I mean, can you do something like the following example:

I have a food menu and choose chicken, can I see a list of those vegetables available with the chicken?
And if I choose potatoes can I choose gravy, butter, or nothing?

You get the idea...

Thanks - MD
Just to be clear, what Flare calls a variable is quite different to how the term is used in programming. In Flare, think of a variable as pre-defined piece of text that can be reused in your topics, for example you might have a variable called CompanyName that is set to MadCap Software. When you build your help, Flare replaces each CompanyName variable in your topics with the text string MadCap Software.

From your question, it sounds like you want to select things from lists, which is something quite different. To have a list in your topic from which you select items, this involves using a HTML form with a drop-down list (select tag). You can include these types of controls in your Flare projects (as they're just standard HTML), although Flare itself isn't really a very good editor for this type of work.

To start off with, see:
http://www.w3schools.com/html/html_forms.asp (forms)
http://www.w3schools.com/tags/tag_select.asp (select tag, used for drop-down lists)
MDonoghue
Jr. Propeller Head
Posts: 4
Joined: Tue Jul 08, 2008 7:12 am

Re: Can I build variables within variables?

Post by MDonoghue »

Thanks for the replies - this posting is related to another posting I have regarding how I am trying to find a way in which to set up material (through programmatic publishing/command line scripting) so that I can have people make selections on the content and then publish it to a printable document.

Basically, provide the ability to create a customized doc for each person that might have options within options - essentially, the old if/then switches.

-MD
Post Reply