Jump to content

Tom Elliott

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Tom Elliott's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Collaborator
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Year ( Get ( CurrentDate ) ) will give you the current year
  2. Do you mean that when you click the Specify button, all the options are unavailable? If so, then this implies RandomField is a calc (or Summary) field - change it to Number; if not, then click the Replace with calculated result option and enter Random.
  3. I believe the following Custom Function will do what you require but my testing has been minimal //SubstituteBetweenTags ( theText ; startTag ; endTag ; searchString ; replaceString ) Let ([ startPos = Position ( theText ; startTag ; 1 ; 1 ) ; startLength = Length ( startTag ) ; endPos = Position ( theText ; endTag ; startPos ; 1 ) ; searchPos = Position ( theText ; searchString ; startPos + startLength ; 1 ) ; searchLength = Length ( searchString ) ; replaceLength = Length ( searchString ) ; theRest = Replace ( theText ; 1 ; endPos + Length ( endTag ) ; "" ) ] ; Case ( startPos = 0 or endPos = 0 ; theText ; searchPos = 0 or searchPos + searchLength ≥ endPos ; Left ( theText ; endPos + Length ( endTag ) ) & SubstituteBetweenTags ( theRest ; startTag ; endTag ; searchString ; replaceString) ; SubstituteBetweenTags ( Replace ( theText ; searchPos ; searchLength ; replaceString ) ; startTag ; endTag ; searchString ; replaceString ) ) )
  4. Thanks for picking that up, and for the correction [although I'd prefer IsEmpty ( char8 )]
  5. I believe the following Custom Function may be what you require, however as others have noted, 14-digit numbers (and indeed any longer number with a multiple of 7 digits) could be treated in one of two ways; this CF does NOT replace 14-digit numbers with "X"s ReplaceSevenDigitNumbers ( theText ) = Let ([ left7 = Left ( theText ; 7 ) ; left14 = Left ( theText ; 14 ) ; char8 = Middle ( theText ; 8 ; 1 ) ; sevenDigits = ( left7 = Filter ( left7 ; "012345x6789" ) ) ; exactlySevenDigits = sevenDigits and ( char8 ≠ Filter ( char8 ; "0123456789" ) ) ; fourteenDigits = ( left14 = Filter ( left14 ; "0123456789" ) ) ] ; Case ( Length ( theText ) < 7 ; theText ; exactlySevenDigits ; "XXXXXXX" & replaceSevenDigitNumbers ( Replace ( theText ; 1 ; 7 ; "" ) ) ; fourteenDigits ; Left ( theText ; 6 ) & replaceSevenDigitNumbers ( Replace ( theText ; 1 ; 6 ; "" ) ) ; sevenDigits ; left7 & ReplaceSevenDigitNumbers ( Replace ( theText ; 1 ; 7 ; "" ) ) ; Left ( theText ; 1 ) & ReplaceSevenDigitNumbers ( Replace ( theText ; 1 ; 1 ; "" ) ) ) ) @LaRetta: Using your CF, any number with 7 or more digits will have its first 7n digits replaced by "X's, where n= Div (number of digits ; 7), e.g. Mask ( "123456789" ) returns "XXXXXXX89" cheers Tom
  6. Ok, try again. I really think I've got it this time - with the proviso that unreasonable time log entries are likely to lead to an unreasonable 'net time' for the job - but as always I'm ready to be shown the error of my ways OverlappingTimes_Demo_v4.fp7.zip
  7. Yes, I figured that out for myself shortly after posting. Ah, well
  8. I think the attached does what you want cheers Tom Ooops - forgot to attach file! OverlappingTimes_Demo_v2.fp7.zip
  9. Hi Daniele The way you had it, the first substitution looks for "1" in your string and if it finds it replaces it with some number which depends on start, but has got to be at least 1, let's suppose it is in fact 2; the the next substitution looks for "2"in your string, but now there may be two 2's in the string - the original one and the one that the first substitution put there, so they both get replaced by 3, and so it goes on for all the following substitutions. This is not what you want. By reversing the order of substitutions, you don't have this problem because each replacement value is at least as great as the number it is replacing and, therefore, greater than the search value for each of the following substitutions cheers Tom
  10. Daniele It's not the SerialIncrement that's the problem, it's the Substitute Try reversing the order of the substitutions: ; [ 9 ; ¶ & SerialIncrement ( start ; 9 ) ] ; [ 8 ; ¶ & SerialIncrement ( start ; 8 ) ] ; [ 7 ; ¶ & SerialIncrement ( start ; 7 ) ] ; [ 6 ; ¶ & SerialIncrement ( start ; 6 ) ] ; [ 5 ; ¶ & SerialIncrement ( start ; 5 ) ] ; [ 4 ; ¶ & SerialIncrement ( start ; 4 ) ] ; [ 3 ; ¶ & SerialIncrement ( start ; 3 ) ] ; [ 2 ; ¶ & SerialIncrement ( start ; 2 ) ] ; [ 1 ; ¶ & SerialIncrement ( start ; 1 ) ]
  11. I'm not sure what you're trying to achieve but I think all you need to do is change your script to the single step Set Field [ NAME::labels; Get ( ActiveRepetitionNumber ) ]
  12. How about: Filter ( StockNumber ; "abcdefghijklmnopqrstuvwxyz" )
  13. You can get rid of the ? in the first line by defining cTimeDiff = If ( Get (RecordNumber ) > 1 ; Time_ - GetNthRecord ( AnimalName_self_Animal::Time_; Get (RecordNumber ) - 1 ) ; GetAsTime ("") )
×
×
  • Create New...

Important Information

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