Jump to content
Server Maintenance This Week. ×

Seconds( Get( CurrentTime) ) returning a "?"


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

Recommended Posts

Actually, I take that back. For some reason I thought it would return a gigantic number from the system clock (date converted into seconds). You're probably just looking at a formatting error.

-Stanley

Link to comment
Share on other sites

I'm actually using it in a calculation for a text field that is part of captKurt's Unique Auto-entered Primary Key IDs v2.1 (http://www.fmforums.com/threads/showflat.php?Cat=0&Number=100135&page=0&vc=1#Post100135).

The code as I'm using it is:

Right( "000000" & Status(CurrentRecordID); 6) &

Middle("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Round(Random*35;1); 1) &

Right( "00000" & Hour ( Get ( CurrentTime ) ) & Minute ( Get ( CurrentTime ) & Seconds ( Get ( CurrentTime ) ) ); 6 ) &

Middle( "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Round(Random*35;1); 1) &

Right( "00000" & Month ( Get ( CurrentDate ) ) & Day ( Get ( CurrentDate ) ) & Year ( Get ( CurrentDate ) ); 6 ) &

Middle( "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; Round(Random*35;1); 1)

And it's putting in a "?" in the 20 digit keys that it generates.

Link to comment
Share on other sites

You have both pre-7 and 7 function calls in your code, so I'll assume you meant Get(RecordID).

If you click in the field, does it display correctly? It could be that the field is not formatted to display enough characters.

Link to comment
Share on other sites

The field is large enough... it's not a truncation issue due to field size on the layout. I'm getting keys like:

000681B00015?12220051

The "?" is always the 13th digit. I was guessing it's because of the Seconds(Get(CurrentTime)) portion of that middle set of 6 in the calculation code.

Link to comment
Share on other sites

Ah, you are missing a closing parens after Minute(Get(CurrentTime) and have an extra one before "; 6" that needs to be removed.

In its current state you are concatenating the current time with seconds and taking the minute result of the concatenation, which is probably nonexistent.

Link to comment
Share on other sites

That would do it, i noticed the missing ")" after the minute thing, but couldn't see where the extra one was.

The weird part is that not all of the keys generated with that method have the "?" in them and I didn't make any changes to the script when i implemented it.

Link to comment
Share on other sites

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