Jump to content

script not working


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

Recommended Posts

I have the following scrip that does not work...

Set Field [Job System::gdate; Middle (Job System::date ; 4; 2)]

If [Left (Job System::gdate; 2) = "1/" or "2/" or "3/" or "4/" or "5/" or "6/" or "7/" or "8/" or "9/"]

Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)]

Else

Exit Script

End If

I think there is something wrong with the If statement, because it performs: Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)] no matter what it finds.

Can anyone point out where I am going wrong?

Link to comment
Share on other sites

I tried simplifying the scrip to...

Set Field [Job System::gdate; Middle (Job System::date ; 4; 2)]

If [Job System::gdate = "1/" or "2/" or "3/" or "4/" or "5/" or "6/" or "7/" or "8/" or "9/"]

Set Field [Job System::gdate; Middle (Job System::date ; 3; 2)]

End If

But it still doesn't work, its like its just ignoring the If statement and resetting the field no matter what!

Link to comment
Share on other sites

The format shouldn't matter, because dates are internally stored as numbers. So Month(datefield) will work for any legal format or system setting since it doesn't pay attention to them.

Link to comment
Share on other sites

This topic is 7096 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.