Action SetFileDate fails with error: 'An unhandled exception (Type mismatch: cDate) occurred in FinalBuilder7.exe [11540]' using VBScript sub BeforeAction: Action.DateTime = Cdate(AndroidProVerAge). This works ok in FB700_3135 and earlier. Using W7 Ultimate.
What is the value of the AndriodProVerAge variable? I just did a quick test and it worked fine here (assuming you are talking about the Touch files action?).
Actually, the value is: 04/12/2014 09:43:43 01:09. This is because the AndroidProVerAge variable is set by %AndroidProVerDate% 0%AndroidVerTime% and the %AndroidProVerDate% is set to %DefaultDate% in an Enhanced Prompt for Variables action. %DefaultDate% is now a date/Time value not just a Date value as in earlier versions.
I had a try of this with the touch file action and am getting a similar error to you. It would appear the date time value is the issue however. “04/12/2014 09:43:43 01:09” doesn’t convert to a valid date/time value. What is the format your looking to use for the variable?
For setting your date variable I suggest using a script which can add the two dates together. The macro you have for “%AndroidProVerDate% 0%AndroidVerTime%” is producing a date time followed by a time value. This then is failing in the Cdate conversion call.
I want format: “04/12/2014 01:09”. As I said, the problem is that, in the latest version, the Project Variables %DefaultDate% variable now has a Date/Time value (“04/12/2014 09:43:43”) instead of just a Date value (“04/12/2014”) - as in previous versions. Can’t you revert to the previous value?
The problem is that we did not change anything in that action recently, so finding which change might cause this is difficult. We will need to review all changes between the two builds, that will take some time.
I believe I have found the change which is affecting you. First though let me make sure that I have your situation correct.
Currently in the script your seeing a variable %DefaultDate% to zero. I assume this has a format string of dd/mm/yyyy, as you expect to only get the date from this variable. Next you use %DefaultDate% to set another date variable with only the date component. Again I am assuming the format string on this variable is also dd/mm/yyyy.
If this is case the reason for the change in behavior is that we fixed a bug where certain date/time values would error on assigning them to a date/time variable. This change was removing the conversion of a date\time variable to a string first, then converting it from the string back into a date/time. This was not necessary and caused unexpected behavior.
It appears that your script is relying on this behavior of first converting the date/time to a string, then into a date/time value.
Sadly I won’t be able to reinstate this behavior as it was incorrect. On the plus side I do see a way to help update your script so that it keeps working the way you expect.
The way to get only parts of the date/time variable is to convert the date/time value to a string. This can be done using the Get DateTime action setting the format string to what part of the date/time you require.
The next way is to set the format string on the date/time variable itself. When the variable is converted to a string it will only write out the formatted string components of the date/time value.
Let me know if that helps clear up the issue your seeing.
Actually, my %DefaultDate% variable’s Basic Type is set to DateTime with Format String of ‘c’. The previous behaviour obviously converted the Date/Time string back to a Date not a Date/Time and, now it has been fixed, my action now fails - after all these years! Anyway, I’ll change it to your 2nd suggestion which should fix the problem. Thanks for your timely response to this issue.