Etnadan Posted July 24, 2006 Posted July 24, 2006 How can I write to an appropriate field the name of another field? the Get ( ActiveFieldName ) doesn't do this as using this Set filed (my_field, Get ( ActiveFieldName )) I get "my_field" into my_field as this is the Active Field I would like something like copy "Get ( ActiveFieldName )" to then go to my_field and paste that content, but I can't figure out how to do so. It seems as every function requires a field name, and I am lost. Thanks a lot
Genx Posted July 24, 2006 Posted July 24, 2006 Set Variable[$activeField ; Get(ActiveFieldName)] Set Field[my_field ; $activeField] Basically it stores the active field as a variable, then goes to your "my_field" and inserts that stored variable.
Etnadan Posted July 24, 2006 Author Posted July 24, 2006 This is the script but it does not work unfortunately Go to Field F12 Set Variable [ $activeField; Value:Get ( ActiveFieldName ) ] Loop If [ Left ( $activeField; 6 ) = "Role: " ] Set Field [ ro_infos::Mar; $activeField ] End If Go to Next Field End Loop I Dont understand what I am doing wrong Thanks for any help
LaRetta Posted July 24, 2006 Posted July 24, 2006 Get( ActiveFieldName) is returning exactly what it is supposed to return ... the field name. Check FM Help for details. Instead, use GetField() which returns the contents. Check FM Help for details on this one as well. Your idea was right ... just wrong function. GetField ( Get ( ActiveFieldName ) ) LaRetta :wink2:
Etnadan Posted July 24, 2006 Author Posted July 24, 2006 I have a long regular tab text file where I have a series of records defined with CR and a series of fields defined by tabs. The file has Names of people and then their Roles. The list is sequential Name1 ... Name2... Name 3500 At the end of Names I have Qualifications Again the list is sequential Role1 ... Role2 ... Role3500 However not every record has the same number of fields. In other words, certain while the breakpoint Names_Roles is generally located at field 18, in other records the field position ranges form field 14 to field 24. I manged to add to each beginning of the Role sequence a Pointer The Pointer is "Role: " I imported the whole file in FMP as a tab file, of course I have no ways to tell in which field the pointer will end up. As the Pointer "ROLE: " is always from field 18 to field 24 I want to create a script which finds the Pointer (the word "Role: ") and tells a field (I called it MAR) in which field the Pointer is located. As the list has more than 3500 records and each record up to 50 fields, this is the fastest way I can think of to locate for each record the "Break Point" Sorry if this all sounds a bit cumbersome but I tried all night as I need to deliver this tommorrow. Thanks for your help
Recommended Posts
This topic is 6740 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