March 18, 200520 yr Author Hey! Have read earlier threads concerning naming an export file using a calc field and found them really interesting. Many have written about the solution Wim Decorte came up with and it seems really nice. But I'm really a novice concerning this cmd command etc so I came up with a new question. Say I use this in a runtime solution. Then the end user will install the runtime anywhere he (or she) wants on the computer. Say I have a export folder in my solution. Now I can't specify the whole command since the runtime could be on C:/ or d:/ or whatever. How can I solve this? Thankful for all your help /David Holmberg ps. the original command looks something like this "cmd /c move ""C:runtime folderexport.txt"" C:runtime folderexport" & DateField & ".txt" ds.
March 18, 200520 yr Hey! Have read earlier threads concerning naming an export file using a calc field and found them really interesting. Many have written about the solution Wim Decorte came up with and it seems really nice. But I'm really a novice concerning this cmd command etc so I came up with a new question. Say I use this in a runtime solution. Then the end user will install the runtime anywhere he (or she) wants on the computer. Say I have a export folder in my solution. Now I can't specify the whole command since the runtime could be on C:/ or d:/ or whatever. How can I solve this? Thankful for all your help /David Holmberg ps. the original command looks something like this "cmd /c move ""C:runtime folderexport.txt"" C:runtime folderexport" & DateField & ".txt" ds.
March 18, 200520 yr Author Hey! Have read earlier threads concerning naming an export file using a calc field and found them really interesting. Many have written about the solution Wim Decorte came up with and it seems really nice. But I'm really a novice concerning this cmd command etc so I came up with a new question. Say I use this in a runtime solution. Then the end user will install the runtime anywhere he (or she) wants on the computer. Say I have a export folder in my solution. Now I can't specify the whole command since the runtime could be on C:/ or d:/ or whatever. How can I solve this? Thankful for all your help /David Holmberg ps. the original command looks something like this "cmd /c move ""C:runtime folderexport.txt"" C:runtime folderexport" & DateField & ".txt" ds.
March 18, 200520 yr Wim has a solution named after him... kudos! David, try using a command generated by the calc: "cmd /c move "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export.txt" "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export" & DateField & ".txt"" To format the guts of this a little more clearly: Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) But OK, i need a little help here. I have to substitute a backslash for a forwardslash, but i don't know how to do that in FM7 (and am too lazy to look it up!). HTH, Jerry
March 18, 200520 yr Wim has a solution named after him... kudos! David, try using a command generated by the calc: "cmd /c move "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export.txt" "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export" & DateField & ".txt"" To format the guts of this a little more clearly: Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) But OK, i need a little help here. I have to substitute a backslash for a forwardslash, but i don't know how to do that in FM7 (and am too lazy to look it up!). HTH, Jerry
March 18, 200520 yr Wim has a solution named after him... kudos! David, try using a command generated by the calc: "cmd /c move "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export.txt" "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export" & DateField & ".txt"" To format the guts of this a little more clearly: Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) But OK, i need a little help here. I have to substitute a backslash for a forwardslash, but i don't know how to do that in FM7 (and am too lazy to look it up!). HTH, Jerry
March 18, 200520 yr Author Ahhhh, there is a Get(filepath) function, well good for me. Will try it on tonight and also look for a solution for the back- to forwardslash. Thanks QuinTech !!
March 18, 200520 yr Author Ahhhh, there is a Get(filepath) function, well good for me. Will try it on tonight and also look for a solution for the back- to forwardslash. Thanks QuinTech !!
March 18, 200520 yr Author Ahhhh, there is a Get(filepath) function, well good for me. Will try it on tonight and also look for a solution for the back- to forwardslash. Thanks QuinTech !!
March 18, 200520 yr When you figure it out, please let me know. The issue, for those who haven't grokked it, is that FMP7 interprets the backslash to mean "the next character is literal text." Thus, the code "/" is interpreted as "open-quote, html <">" and there is no close-quote. In FMP6 language, this would be equivalent to three quotes in a row.
March 18, 200520 yr When you figure it out, please let me know. The issue, for those who haven't grokked it, is that FMP7 interprets the backslash to mean "the next character is literal text." Thus, the code "/" is interpreted as "open-quote, html <">" and there is no close-quote. In FMP6 language, this would be equivalent to three quotes in a row.
March 18, 200520 yr When you figure it out, please let me know. The issue, for those who haven't grokked it, is that FMP7 interprets the backslash to mean "the next character is literal text." Thus, the code "/" is interpreted as "open-quote, html <">" and there is no close-quote. In FMP6 language, this would be equivalent to three quotes in a row.
March 18, 200520 yr I believe you've got it backwards (forgive the pun) Backslash is the escape character. As you say, the escape character means "the next character is literal text." Therefore, "" is interpreted as a single backslash. There should be no problems with "/".
March 18, 200520 yr I believe you've got it backwards (forgive the pun): Backslash is the escape character. As you say, the escape character means "the next character is literal text." Therefore, "" is interpreted as a single backslash. There should be no problems with "/".
March 18, 200520 yr I believe you've got it backwards (forgive the pun): Backslash is the escape character. As you say, the escape character means "the next character is literal text." Therefore, "" is interpreted as a single backslash. There should be no problems with "/".
March 18, 200520 yr I see. That explains why i couldn't figure out how to do it -- i was fooling with the "/" portion of my calculation rather than the "" portion. Thanks, comment. So, David, your calculation should be: "cmd /c move "" & Substitute ( Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) ; "/" ; "" ) & "export.txt" "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export" & "DateField" & ".txt"" J
March 18, 200520 yr I see. That explains why i couldn't figure out how to do it -- i was fooling with the "/" portion of my calculation rather than the "" portion. Thanks, comment. So, David, your calculation should be: "cmd /c move "" & Substitute ( Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) ; "/" ; "" ) & "export.txt" "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export" & "DateField" & ".txt"" J
March 18, 200520 yr I see. That explains why i couldn't figure out how to do it -- i was fooling with the "/" portion of my calculation rather than the "" portion. Thanks, comment. So, David, your calculation should be: "cmd /c move "" & Substitute ( Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) ; "/" ; "" ) & "export.txt" "" & Substitute ( Left ( Get ( FilePath ) ; Position ( Get ( FilePath ) ; "/" ; 1 ; PatternCount ( Get ( FilePath ) ; "/" ) ) ) ; "file:/" ; "" ) & "export" & "DateField" & ".txt"" J
Create an account or sign in to comment