Page 1 of 2

Form entry

Posted: Tue Jan 28, 2014 9:30 pm
by marcelloe
This is what I want to do but not sure the best way to do it. I hope I explain it in a way that others will understand.

Background:
I have 4 cards in my stack and the first is main menu.

On the main menu card I want to use a button to launch a form. On the form I have 4 field for the user to fill out. I want to create those fields from the form on the card that is specified to start on. Also, I want the fields repeated on the other cards for a certain number of times. There will be different entries that will do the same, but with a different name.

For Example: I fill out the form to start on card 1 and run for 4 entries. The fields are created on card 1 and I want this information to be on card 2, card 3 and then back to 1, but not put a new entry on because it is already there.

Thanks

Mark

Re: Form entry

Posted: Wed Jan 29, 2014 12:45 am
by dunbarx
Hi.

But if the first card is always a "main" card, then you need to go to another card (or group of cards) for each form type, no? You have to decide this first.

You might also open a substack for the forms. Then from that card (or stack) you can create new cards with the same format. But in any case, this is straightforward. The selection of the form type will dictate how you populate (or select) the field layouts. Do you know how to copy and clone cards and objects? Write back if you need more...

Craig Newman

Re: Form entry

Posted: Wed Jan 29, 2014 3:03 am
by marcelloe
The main card is like a big over view and the subsequent card are a small view. The 3 other cards are the same but with a different view. They are going to have the same fields. I want to be able to populate those fields from the main card. Populate the fields to the corseponding cards. I hope that is clearer.

I know how to copy a card.

Mark

Re: Form entry

Posted: Wed Jan 29, 2014 4:31 pm
by marcelloe
Craig:

Are you talking about copying or cloning cards in edit mode? I know how to do that. Is there something else you are talking about?

Re: Form entry

Posted: Wed Jan 29, 2014 4:37 pm
by dunbarx
Hmmm.

Still not quite sure what you want, but we will get through this somehow.

Do you mean that the "small view" is a smaller window? And do you mean that the other cards are yet a differently sized window?

I assume not, rather that the destination cards are all the same size If so, it is probably best to use a substack for those. Your main card will open a substack, and depending on what option you choose on that main card, the substack, which can have as many cards as you wish. will be populated with the fields you require. If these are changeable, you will need to create them on the fly. If the options available at the main card always reference fixed numbers of fields for each choice as well as a fixed number of cards for that choice, then you can prepare the substack as needed. Say the first four cards are called by option one in the main card, and cards five through ten are called by option two. Or whatever.

Bottom line, if your option choice requires a certain number of fields on a certain number of cards, you can either make these as needed or navigate to them already prepared. But are there three different window sizes, or two, or one? Write back...

Craig

Re: Form entry

Posted: Wed Jan 29, 2014 4:40 pm
by dunbarx
Hmmm, some more.

When you say "different view" do you mean simply that the visible objects change? That the controls you have on your main card are different than the field arrangement you have on your other cards? If so, the problem is simpler. Let me know...

Craig

Re: Form entry

Posted: Wed Jan 29, 2014 5:04 pm
by marcelloe
sorry to be so confusing. I know what I want to do, but can't seem to explain it. I want a button on the main card to to create fields on the other cards (like a new entry each time). The 3 cards will be the same but with a different name. If I want the create an entry for 5 times it will put an entry on cards 1-3 and then repeat for cards 1 and 2, but I don't want multiple entries of the same on each card. I hope that is more clear. I have attached a sample stack with no scripts, but it will give you a better idea of what i want to do.

Re: Form entry

Posted: Wed Jan 29, 2014 5:40 pm
by dunbarx
Hi.

I sort of get it. But if you know how to create new fields and name them as you go, and also create new cards and name them as well, what is your actual question?

Your main card will have a way to choose an option. This will create one or more cards and also create one or more fields on those cards. You then can have the user enter the data and start a process of some kind.

I would try to arrange it so that you navigate to prepared card ranges as I said earlier, but this is up to you. It would be much simpler. But if your choices on the main card always require building custom arrangements of cards and fields, then you can certainly create them as needed. Will you discard those new cards when you are done with them?

I was unable to download your sample stack.

Craig

Re: Form entry

Posted: Wed Jan 29, 2014 5:46 pm
by dunbarx
Hi.

I did download the stack. So you have a main card with a couple of buttons, and those buttons send you to another card. On that new card you have some arrangement of fields for user entry. Much easier. Works fine.

Now, what is it that you need to know? Do the fields on the following cards change? Are there always four cards following? I am still not sure what needs to happen when you click on the buttons on the main card.

Craig

Re: Form entry

Posted: Wed Jan 29, 2014 5:55 pm
by marcelloe
I think I left an important detail. I want to be able to do this after the stack has be turned into a standalone app. I want the 3 cards to be most blank to start out, but want a button on the main menu to create 4 fields and put them on the specified cards in a row. There will be multiple different entries on those 3 cards. The field will contain different data. I don't know how to get the button to place the field on those cards. I do apologies.

Re: Form entry

Posted: Wed Jan 29, 2014 6:29 pm
by dunbarx
OK.

Make a new mainstack. Make three new cards. On the first card, make a new option menu. It will come preloaded with three options. In the script of that button, place and save this handler:

Code: Select all

on menuPick pItemName
   switch pItemName
      case "choice 1"
         go cd 2
         create fld "F1"
         create fld "F2"
         create fld "F3"
         set the topLeft of fld "f2" to the botLeft of fld "f1"
         set the topLeft of fld "f3" to the botLeft of fld "f2"
   end switch
end menuPick
Now select "option 1". You will have three fields on card 2, already named, and located a certain way. Is this enough to get you going?

Note that when you make your standalone, this stack has to be in the stack file of the executable. I like the "splash" stack method. If you do not know about this sort of thing, don't worry, We will deal with it later.

Craig

Re: Form entry

Posted: Wed Jan 29, 2014 7:34 pm
by marcelloe
Do I create a new main stack and also keep my original. I will be using both main stacks. Is that correct? Am I creating the fields on cards 2 and 3. I just want to make sure I understand.

Can you go unto more detail of what is going on. Just to make sure I am following.

Re: Form entry

Posted: Wed Jan 29, 2014 8:03 pm
by dunbarx
This was just an experiment to give you a head start.

You will have only one working stack, as I see it. But you will save that stack into its own file, and then attach that file to another stack file (the "splash stack") that will be the executable in your standalone. Leave that alone for a while. Work on your project in the one stack. Most of your effort will be to get that working the way you want it to.

Craig

Re: Form entry

Posted: Wed Jan 29, 2014 8:12 pm
by marcelloe
Can you go into more detail just to make sure I understand.

Thank you

Mark

Re: Form entry

Posted: Wed Jan 29, 2014 8:31 pm
by dunbarx
More detail about the working stack? Remember, that is the only thing you need to concern yourself with at this time.

If so, what do you need? Do you see what that button in the experiment does? Can you extend the handler in the option button to handle the other cards? Can you rearrange the fields in the "choice 1" option to suit your needs? Can you add label fields as needed so the user knows how to proceed? All these are manageable under script control.

Where are you with your understanding and experience of LiveCode? I am always concerned that new users undertake projects before learning how to use the tools to make those projects.

Craig