Jump to content
Sign in to follow this  
Asu

Setting multiple fields sequentially

Recommended Posts

Hello FM Mavens,

I need to accomplish the following task.

I have several fields, sequentially tabbed, named A, B, C, D etc. Each of them can be set to 0, 1, 2, 3 or 4.

User sets some of the fields to a number other than 0

THEN: I need a script that sets the fields that were left empty to zero.

Obviously it could be done by explicitly defining the fields but there are dozens. 

I thought of something like Go to next field, if (isempty "next field") set "next field" to 0. The problem is that the (isempty <field>) function requires an explicit field definition so how do I accomplish that? Or there may be a better solution?

Thanks

Asu

Share this post


Link to post
Share on other sites

I strongly suspect that instead of "dozens" of similar fields, you should have records in a related table instead. I bet that would make a lot of things much easier, not just the current task.

Anyway, if you are able to loop through the fields using Go to Field [Next], you can test if the current field is empty by =

IsEmpty ( Get (ActiveFieldContents ) )

 

Share this post


Link to post
Share on other sites

Sure but this is a concept question. 

Thank you for your answer. Sorry, I forgot to ask the other half. Now I need to set the "active field" to a value. 

 

 

Share this post


Link to post
Share on other sites
7 minutes ago, Asu said:

Now I need to set the "active field" to a value. 

Use the Set Field[] script step, with no field specified. From help

If no field is specified and a field is selected in Browse mode or Find mode, that field is used.

 

9 minutes ago, Asu said:

this is a concept question

OK, but I still think the concept is flawed.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.