AnsweredAssumed Answered

File Path Reference creation

Question asked by mfl666 on May 20, 2011
Latest reply on May 20, 2011 by mfl666

Title

File Path Reference creation

Post

I have a Set Variable calc which creates a file path reference for storing our pics.

Given the following calc.......

Set Variable [ $filepath; Value:$filepathserver & "MondettaEnterprise/Groups/ERP/Documents/Programs/" & Style_Main::Style_ID_Program_SN & "_Photos/" & Style_Main::Style_ID_Serial_Number & "_" & Style_Main::Style_Count_Reference_Photos_Count & "." &
Case (

If ( Middle ( ( Right ( GetValue ( Ref_Photos::RP_Photo_Path ; 3 ) ; 5 )); 1; 1 ) ; "."; Right ( GetValue ( Ref_Photos::RP_Photo_Path ; 3 ) ; 5 )) ;

If ( Middle ( ( Right ( GetValue ( Ref_Photos::RP_Photo_Path ; 3 ) ; 5 )); 2; 1 ) ; "."; Right ( GetValue ( Ref_Photos::RP_Photo_Path ; 3 ) ; 4 )) ;

If ( Middle ( ( Right ( GetValue ( Ref_Photos::RP_Photo_Path ; 3 ) ; 5 )); 3; 1 ) ; "."; Right ( GetValue ( Ref_Photos::RP_Photo_Path ; 3 ) ; 3 )) ) ]

Given that "Ref_Photos::RP_Photo_Path" contains

size:529,352

image:2110_kw_37_14.jpeg

imagemac:/Macintosh HD/Documents/Graphics/MyPictures/Misc/2110_kw_37_14.jpeg

Why is it that if i pick a file that is either ".jpg" , ".png" , ".PDF" I get a file path with the proper extension but if i happen to pic a file that is ".jpeg" my file path extension becomes "filename.peg".

I have run this through debug using the first IF statement and it calculated it as ".jpeg" in the monitor but the path came out ".peg".

Logically the first IF statement should be the one its going to choose, or am I wrong.

I have tried removing the "." & , but then I got "filenamepeg"

On a second note is there an easier way of extracting the file extension and creating the file path.

Thank you

Michael

Outcomes