Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7963 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Oh, this is very exciting to learn! laugh.gif

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

Posted

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

Posted

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

Posted

Setfield( mad.gif, Substitute "$", smile.gif)

That is the way the world goes...or at least would like it to go.

May be with a looping script. wink.gif

Glad to see you are so excited !!

Have a nice Saturday night grin.gif

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.