LaRetta Posted February 8, 2003 Posted February 8, 2003 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
LiveOak Posted February 8, 2003 Posted February 8, 2003 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
Ugo DI LUCA Posted February 8, 2003 Posted February 8, 2003 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
LaRetta Posted February 8, 2003 Author Posted February 8, 2003 Thanks Brent and Ugo for responding! I
Ugo DI LUCA Posted February 8, 2003 Posted February 8, 2003 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
Recommended Posts
This topic is 7963 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