February 8, 200322 yr Oh, this is very exciting to learn! Thanks to DJ, I found out that using Set Field (with anything) will remove a $ from a numeric field. Well, that got me to thinking about why it worked. And then I realised that it had a much greater implication in terms of handling mixed-data fields. If I am dealing with a numeric field that also holds text (either because of an import from a text file or from changing a field definition), it is possible to
February 8, 200322 yr This is all part of the subject of data types and conversions between data types. Sorry, if a date field contains non-date information, it is all viewed as text and converting to date just wipes out the entire contents of the field. Text information entered into a date field is converted upon entry, if FM can figure out what to do (i.e. 5/5/01 would be converted to a date). To use a Set Field to enter a date: SetField(date, "5/5/01") won't work, SetField( date, Date(5,5,2001) will, as it forces entry of data with the type date. Remember that dates are stored internally as numbers, January 1, 0001 is 1. -bd
February 8, 200322 yr using Set Field (with anything) will remove a $ from a numeric field. Well La Retta, it worked because your field was num and that $ had been entered into the field, while if it had been enter via the format number function, the set field (fieldnum,(-1) x fieldnum) would not have worked. Set field can be used in script while Replace, Substitute are used in Calculation (or combined with Setfied (Field, Substitute(...),):. But I do agree with you that Setfield, along with the new Getfield are very useful
February 8, 200322 yr Setfield( , Substitute "$", ) That is the way the world goes...or at least would like it to go. May be with a looping script. Glad to see you are so excited !! Have a nice Saturday night
Create an account or sign in to comment