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

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

Recommended Posts

  • Newbies
Posted

Hi, I've created this script but is giving some trouble and I can't understand why. I'm using global fields to temporarily store other fields data. Kind of a clipboard for several fields. This is the script.

Copy(Select, "Field1")

Paste(Select, "GlobalField1")

Copy(Select, "Field2")

Paste(Select, "GlobalField2")...

Then I have another script that does the opposite.

Copy(Select, "GlobalField1")

Paste(Select, "Field1")...

It works well when on Browse mode, it goes totally crazy in Find mode. Any ideas why and how can I fix this?

  • Newbies
Posted

I guess I just found out that when in Find mode, the Copy (to clipboard) function doesn't work, but the Paste (from clipboard) does.

Again, I need a fix, is this a FMPro 6.4 bug, any workarounds?

Posted (edited)

Use Set Field rather than Copy/Paste. It's much more efficient and less prone to problems.

Edit: Also keep in mind when you go intol find mode all fields are cleared of data except global fields. Just a heads up you can't copy something that isn't there.

Michael

Edited by Guest
Added last paragraph.
Posted

Indeed it's expected behaviour ...AudioFreak doesn't touch that it's actually a bad habit to tamper with the users clipboard from a software solution, and it's common newbe blunder to commit.

Further more is the command a little limited in it's reach, since only visible fields can be copied, and since this is a database is it a vessel of meaning, meaning that you easily can disguise or illiminate the nice to knows from the need to knows of your layouts.

Set Field is the only propper way to change values in fields, while lookups might have their uses, is it only under 2NF where filemakers unstored calcfields exhibit inconveinces can lead to the denormalization a lookup in reality is, or the saving of historic data.

--sd

Posted

Just to clarify:

Instead of these two steps:

Copy(Select, "Field1")

Paste(Select, "GlobalField1")

Use this one step:

Set Field(GlobalField1, Field1)

One exception where you can't use Set Field is when you want to do a Find for a date range, e.g. "1/1/01...2/2/02". It will cause field validation to fail. I'd still avoid copy and paste and use Insert instead.

This topic is 6366 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.