falkaholic Posted March 25, 2004 Posted March 25, 2004 I've been toying around with FM7 for a little bit now, and I'm a little confused about the way scripting is in Fm7... If I'm running a script that effects two tables, is the only way to switch the scope by using a Go To Layout (for Set Field etc)? Is there another way I haven't found yet? P.S. FileMaker 7 is a great great improvment, I've been excited since I saw the technical preview. FM 6 and below was a pain i the neck! Version: v7.x
Vaughan Posted March 26, 2004 Posted March 26, 2004 This has got me too Eric. I think the Go to Layout is the only way. There is no "Get (TableName)" function either, so a defensive script writer may have to explicitly put Go To Layout steps in all scripts that work with fields, At least that's what I'm thinking at this point (and doing).
falkaholic Posted March 26, 2004 Author Posted March 26, 2004 There is the Get(ActiveFieldTableName), which returns the name of the table of the current fields, kind of close, but still not that best. Also, the Get(LayoutName) might help. If you name your layouts with someone like TABLENAME-DESCRIPTION. Then use LeftWords(Get(LayoutName),1), you'd have your table name. Could even use Developer to make your own custom function now! Or, as i just found, could just use the Get(LayoutTableName), which returns the current layouts' table. Vaughan said: This has got me too Eric. I think the Go to Layout is the only way. There is no "Get (TableName)" function either, so a defensive script writer may have to explicitly put Go To Layout steps in all scripts that work with fields, At least that's what I'm thinking at this point (and doing).
RalphL Posted March 27, 2004 Posted March 27, 2004 For SetField couldn't you just use SetField[ TO::Field Name, Value]?
falkaholic Posted March 27, 2004 Author Posted March 27, 2004 Its not so much for Set Field, but more for Go To Record [First], which tables' record does it go to? the table of the current layout. RalphL said: For SetField couldn't you just use SetField[ TO::Field Name, Value]?
RalphL Posted March 27, 2004 Posted March 27, 2004 I have a file with 3 tables and a layout for each with buttons First, Prev, Next & Last. One set of scripts works with any layout and stays in that layout. I also have a set of buttons that moves between the layouts using one script. Does this answer your question?
falkaholic Posted March 28, 2004 Author Posted March 28, 2004 Kinda, thats not what I'm getting at. Having, say, Go To Record[] relative to the table your on is great. Though if you doing a more complex script were you say find records in another table/layout and go through them one by and add data to the original layout/table, you'll have use Go To Layout in between all the steps. RalphL said: I have a file with 3 tables and a layout for each with buttons First, Prev, Next & Last. One set of scripts works with any layout and stays in that layout. I also have a set of buttons that moves between the layouts using one script. Does this answer your question?
Recommended Posts
This topic is 7544 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 accountSign in
Already have an account? Sign in here.
Sign In Now