Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Question concerning the "Wim Decorte solution"

Featured Replies

  • 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.

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.

  • 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.

Wim has a solution named after him... kudos! smile.gif

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

Wim has a solution named after him... kudos! smile.gif

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

Wim has a solution named after him... kudos! smile.gif

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

  • 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 !!

  • 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 !!

  • 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 !!

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 <&#34;>" and there is no close-quote. In FMP6 language, this would be equivalent to three quotes in a row.

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 <&#34;>" and there is no close-quote. In FMP6 language, this would be equivalent to three quotes in a row.

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 <&#34;>" and there is no close-quote. In FMP6 language, this would be equivalent to three quotes in a row.

I believe you've got it backwards (forgive the pun):P

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 "/".

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 "/".

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 "/".

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

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

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

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.