AnsweredAssumed Answered

New to FM...

Question asked by tguise on Dec 4, 2013
Latest reply on Feb 25, 2014 by rmittelman

"THANKS in Advance" to anyone who has a moment to read the following and provide "any guidance", even if it is "quit while you are ahead"


After purchasing FM Pro 12 and going through the first 7 FM Tutorials and a ref book or so, I knew this would be interesting... I just didn't know how interesting...

(Bkgrnd: BAL, DB2, C, VB6, Dbase... 10-12 years ago...)


After building some layouts using TAB's I realized you can't change the Ref Tables, so I built multiple nested interactive tabs (& tables) and that was OK... I have had some successes, but this one...



While I know that you can place a field on a layout then check Calculate and (for example) provide the text formatting code to format a 10 digit phone number.

(ie) Table::Field = "(" & Left ( Phone ; 3 ) & ") " & Middle ( Phone ; 4 ; 3 ) & "-" & Right ( Phone ; 4 ) Works well...


That being said, what if one wants to use a Set Script Trigger "OnObjectExit()" so as to better understand what is happening under the hood?


Enter 8005551212 into layout field

Script "Format_PhoneNum"


Set Variable [$input1; TestTbl::phone_field]

[Debug/Data View] TestTbl::phone_field 8005551212

$input1 8005551212



Set Variable [$input2; "(" & Left ( $input1 ; 3 ) & ") " & Middle ( $input1 ; 4 ; 3 ) & "-" & Right ( $input1 ; 4 )

[Debug/Data View] TestTbl::phone_field 8005551212

$input1 8005551212

$input2 (800)^555-1212


Set Field [TestTbl::phone_field=$input2]

[Debug/Data View] TestTbl::phone_field 0

$input1 8005551212

$input2 (800)^555-1212


While starring at this off and on for a few days, I have tried other versions in an attempt to write a <$variable> into a Table::Field. Each time the result was not successful.


(Very new to FM but trying to catch up...) Any insight is appreciated and "Thanks" again.