Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5947 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I need to make a solution to show the results of a Martial arts tournament. All I want to do is be able to click on the field of the contestant who wins each match and have that data copied to the appropriate result field. I can do it by a simple copy/paste script but that would mean writing 62 separate scripts. I have a feeling it could be done with 1 script and script parameters but I am not clear on the whole parameter concept. Any help greatly appreciated as usual.

Thanks

Fred

WKO_Tornament.zip

Posted (edited)

I need to make a solution to show the results of a Martial arts tournament. All I want to do is be able to click on the field of the contestant who wins each match and have that data copied to the appropriate result field. I can do it by a simple copy/paste script but that would mean writing 62 separate scripts. I have a feeling it could be done with 1 script and script parameters but I am not clear on the whole parameter concept. Any help greatly appreciated as usual.

Thanks

Fred

It's not a script problem, it's a structure problem. There should only be ONE field; contestant; and relationships designed to create your schedule. Any time you see a design with Thing1, Thing2, Thing23, it's a disaster. When you do it properly, the data is in a portal and you can capture the individual record data with the button.

WKO.zip

Edited by Guest
updated file
Posted

FYI.. when i posted my solution i thought about the exact same thing.

I agree that relational restructuring of the data is the optimal solution but that was not what was asked.

I was just trying to provide an opinion on how to solve the problem.

Posted (edited)

FYI.. when i posted my solution i thought about the exact same thing.

I agree that relational restructuring of the data is the optimal solution but that was not what was asked.

I was just trying to provide an opinion on how to solve the problem.

You are completely missing the point. Your structure is the CAUSE of your problem.

What I provided IS EXACTLY how to solve the problem you asked about.

You cannot take umptynine fields and attach the same script to them and get different values.

When you attach a script to an item in a portal, then you can attach as a script parameter a value from the record it is associated with.

I didn't do that part for you because I thought it was so obvious.

But let me spell it out. You would pass the contestant ID and Level.pair data to your script.

In my example, next to Contestant1, you would have a button

Perform Script [ Advance; List( RoundsX::ContestantID1; RoundsX::Level.Pair) ]

Next to Contestant2, you would have a button

Perform Script [ Advance; List( RoundsX::ContestantID2; RoundsX::Level.Pair) ]

Edited by Guest
Posted (edited)

OK

I am now completely confused.

I used the first suggestion and it worked flawlessly. I made each contestant into a button and when clicked on it and that contestant was moved to the appropriate next result.

Now with this latest suggestion, I find it much more elegant. I understand the reason for the structure change and that was what i had in mind in the first place, but could not figure out (and still can't) how to pass the results to the appropriate result field.

Ididn't do that part for you because I thought it was so obvious.

Not obvious to me. Remember I am just a beginner with all this.

I am not trying to get this done for me. I am only trying to get headed in the right direction. as you can see from the attached file, I have the first suggestion implemented and it seems to be working correctly.

The thing about your suggestion and the example you attached is that it seems to be a better solution. My problem is with the whole scripting thing.

In my example, next to Contestant1, you would have a button

Perform Script [ Advance; List( RoundsX::ContestantID1; RoundsX::Level.Pair) ]

When you made that statement you made an assumption that I would understand. I do not. Is the Script "Advance" the one in KrisM's reply? If so, I have no idea how to modify it to work with your example. Also should I assume that the list function is the script parameters?

A little more explanation would be greatly appreciated.

Thank you

Fred

WKO_Tornament.zip

Edited by Guest
added file
Posted

BruceR.. it is not "My problem" as you suggest because I am not the originator of the thread. I hope/think I misunderstood and that your reply was for Fred.

It is Fred who needs instruction/explanation on your solution.

Good luck explaining how to conceptualize and design for relational structure.

Peace,

Kris

Posted

Kris

Thanks for the original reply. It was very helpful. Look at the file in my previous message. Any comments greatly appreciated.

I have a fair grasp on relational structure. I agree that it would be better to do as BruceR suggested. My problem is not with building a solution relationaly, it is with getting scripts to work within that structure.

Example:

In my example, next to Contestant1, you would have a button

Perform Script [ Advance; List( RoundsX::ContestantID1; RoundsX::Level.Pair) ]

OK, I can get the parameter no problem. I can pass that to the current record in the current portal. BUT how to pass it to the correct record in the correct portal. I don't know. Contestant wins level 1 match 1 now put that result into level 2 match 1. HOW.

At least your example gave me a way to do what I need to do and i thank you for that.

Thanks again.

Fred

Posted

Kris

Thanks for the original reply. It was very helpful. Look at the file in my previous message. Any comments greatly appreciated.

I have a fair grasp on relational structure. I agree that it would be better to do as BruceR suggested. My problem is not with building a solution relationaly, it is with getting scripts to work within that structure.

Example:

OK, I can get the parameter no problem. I can pass that to the current record in the current portal. BUT how to pass it to the correct record in the correct portal. I don't know. Contestant wins level 1 match 1 now put that result into level 2 match 1. HOW.

At least your example gave me a way to do what I need to do and i thank you for that.

Thanks again.

Fred

If you know what round/pair you are on (e.g. 1.3) - which you do - then you can obviously calculate what the next level is and attach the winner to the appropriate record.

The problem with the other approach is that every button must be different. With this approach, you just set up the button, just dup it to the next portal column.

Posted

OK, I can get the parameter no problem. I can pass that to the current record in the current portal. BUT how to pass it to the correct record in the correct portal. I don't know. Contestant wins level 1 match 1 now put that result into level 2 match 1. HOW.

Fred

1. You get the parameter FROM the portal record.

2. Addition. 1+1 = 2.

Posted

Thanks

Still don't quite get it.

OK, I have the script parameter....List(RoundsX::ContestantID1;RoundsX::Round.Match)

It is a list

1

1.1

The 1 needs to be put in the Winners field in the current record and in the ContestantID1 field in the 2.1 record.

1) How to parse the numbers out of the list.

2) If I add 1+1 and get 2 that will not give me 2.1

3) And 1.16 + 1 definitely does not = 2.8

I guess @ 60 years old, my brain needs to be force fed in order to learn.

Thanks again in advance for your time and expertise.

Fred

Posted

Ok...

I figured how to parse the parameters into the needed values. (Actually quite easy)

Now that I have the data I still can't get the script to enter the data into the appropriate portal record.

I have tried a find, Go to portal row by calculation... everything I can think of.

What I need it to do is take the parsed data and enter it in th appropriate portal record.

What am I missing? It seems to me that it should be easy.

Fred

WKO_Tornament.zip

Posted (edited)

Ok...

I figured how to parse the parameters into the needed values. (Actually quite easy)

Now that I have the data I still can't get the script to enter the data into the appropriate portal record.

I have tried a find, Go to portal row by calculation... everything I can think of.

What I need it to do is take the parsed data and enter it in th appropriate portal record.

What am I missing? It seems to me that it should be easy.

Fred

Take a look at this. Note use of GetValue instead of MiddleValues; also note use of global field to select a particular round.

WKO.zip

Edited by Guest
Updated file
Posted

Thanks

I really appreciate the time you have taken to help me with this. You have given me a lot to work with. I think this will go a long way towards my understanding of scripting.

I was half way finished writing my script(See attached) when you posted this. Now all I need is to spend time with what you have done.

Again your help is very greatly appreciated.

Fred

WKO_Tornament.zip

Posted (edited)

Thanks

I really appreciate the time you have taken to help me with this. You have given me a lot to work with. I think this will go a long way towards my understanding of scripting.

I was half way finished writing my script(See attached) when you posted this. Now all I need is to spend time with what you have done.

Again your help is very greatly appreciated.

Fred

Thanks. Note that I have update the file in the previous message. Take a closer look. You're making it way harder than it needs to be. Looping through portals like that is not an efficient or advisable method. Actually I'll just go ahead attach the latest file to this message.

WKO.zip

Edited by Guest
File updated
Posted

Thanks again

Look at your file and click one of the buttons for round 1 match 10 and see what happens. Kinda srange as the buttons work everywhere else.

Fred

Update:

Figured out why. The round.match is the same for 1.1 and 1.10. The trailing zero is stripped off in the set field step.

In the script step Set Field [Rounds_SameEvent::zNextRoundMatch; $Round & "," $Match] the value is the same for both 1.1 and 1.10

Been trying to get around it but it looks to be beyond my feeble and primitive skills.

Posted (edited)

Thanks again

Look at your file and click one of the buttons for round 1 match 10 and see what happens. Kinda srange as the buttons work everywhere else.

Fred

Update:

Figured out why. The round.match is the same for 1.1 and 1.10. The trailing zero is stripped off in the set field step.

In the script step Set Field [Rounds_SameEvent::zNextRoundMatch; $Round & "," $Match] the value is the same for both 1.1 and 1.10

Been trying to get around it but it looks to be beyond my feeble and primitive skills.

Good (and informative) catch. Change the field type for field zRoundMatch to text, and for Round.Match change the calculation result to text.

WKO.zip

Edited by Guest
Posted

Thanks,

That did the trick.

Again thanks for all the help... greatly appreciated.

I have learned a lot from this exchange. Thanks for your patience.

Will post the final solution when finished. Hope there are no more problems.(Yea sure... LOL)

Fred

This topic is 5947 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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