dbTalk Databases Forums  

"Set Variable" for FMP6?

comp.databases.filemaker comp.databases.filemaker


Discuss "Set Variable" for FMP6? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cerulean
 
Posts: n/a

Default "Set Variable" for FMP6? - 08-02-2009 , 01:11 PM






Hi,

One last struggle on this solution ... So many hours on all of this,
as I'm sure has happend to others here <g>. But this time, I'm
determined to finish it, come what may <g>.

From the help file, I figured out how to save an export of my data to
a text file, as mentioned in another thread here. The only difficulty
is that the path needs to be selected, allbeit I imagine that's only
the first time around, or until one changes computers, etc. This is
the script:

Sort [Restore, No dialog]
Export Records [Restore, No dialog, "Word List.txt"]

I found out that there is a way to automate the path portion with a
relative path solution. For FMP8 and above, I believe, it would be:

Set Variable $fullpath; Value:Get ( DesktopPath ) & "Word list" ]

Also, found that along with getting a path to the current desktop,
could also do the same for the file the database solution is in via:

Get(FilePath)

But I have FMP6. Does anyone know what the solution for "Set
Variable" would be FMP6? Apparently, "Set Variable" is an FMP8 and
above feature. But there is a way to do it in FMP6, that much I found
out. It's just that no-one said what that is.

Also, would I work the script above with the FMP6 alternative like
this?:

Sort [Restore, No dialog]
Set Variable $fullpath; Value:Get ( DesktopPath ) & "Word list" ] **
Export Records [Restore, No dialog, "Word List.txt"]

** FMP6 way here

Thanks for everyone's help! D

Reply With Quote
  #2  
Old   
Lynn Allen
 
Posts: n/a

Default Re: "Set Variable" for FMP6?X-Trace - 08-02-2009 , 11:26 PM






On 2009-08-02 11:11:55 -0700, Cerulean <Spamming (AT) NOTallowed (DOT) com> said:

Quote:
But I have FMP6. Does anyone know what the solution for "Set
Variable" would be FMP6? Apparently, "Set Variable" is an FMP8 and
above feature. But there is a way to do it in FMP6, that much I found
out. It's just that no-one said what that is.
Sorry, there is no functionality that will let you dynamically name an
export file in FM6. You can use a global field to hold any calc you
want, but you can't include the calc results in the file name.

Generally what we did way back then <grin> is to export to a
pre-determined file name in a pre-determined location, and then use a
file-management plugin to move and rename the file, often deleting the
original export file in the process.

The most common plugin was something like the Troi File plugin.

Not sure what your motivation is to continue using FM6, but if at all
possible, I'd get the users to upgrade.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA

Reply With Quote
  #3  
Old   
Cerulean
 
Posts: n/a

Default Re: "Set Variable" for FMP6? - 08-03-2009 , 08:03 AM



On Sun, 2 Aug 2009 21:26:01 -0700, Lynn Allen <lynn (AT) NOT-semiotics (DOT) com>
wrote:

Quote:
On 2009-08-02 11:11:55 -0700, Cerulean <Spamming (AT) NOTallowed (DOT) com> said:

But I have FMP6. Does anyone know what the solution for "Set
Variable" would be FMP6? Apparently, "Set Variable" is an FMP8 and
above feature. But there is a way to do it in FMP6, that much I found
out. It's just that no-one said what that is.

Sorry, there is no functionality that will let you dynamically name an
export file in FM6. You can use a global field to hold any calc you
want, but you can't include the calc results in the file name.

Generally what we did way back then <grin> is to export to a
pre-determined file name in a pre-determined location, and then use a
file-management plugin to move and rename the file, often deleting the
original export file in the process.

The most common plugin was something like the Troi File plugin.

Not sure what your motivation is to continue using FM6, but if at all
possible, I'd get the users to upgrade.
--
Lynn Allen
Hi, thanks for the information.

I'm thinking that while I'll do is continue to use the script as I
have it but put some sort of popup to somehow remind me where the file
is going, or whatever.

And if I can figure it out, if I have this right, a global field (?)
can capture a path the user browses to (??). Perhaps that's what I
can have, too, somehow.

Re the versions, nah, it's just me, no users. And I don't use FMP
enough to upgrade; I can't justify the expense because of htat. FMP6
serves me well enough. I'm just a hobbyist developer, and am don't
have much advanced knowledge (as you can probably tell). The database
will be good enough at this level, I think. So I sacrifice having a
relative path during an automatic save <sigh>. Well, I can live with
that.

Thank you! D

Reply With Quote
  #4  
Old   
Lynn Allen
 
Posts: n/a

Default Re: "Set Variable" for FMP6?X-Trace - 08-03-2009 , 10:31 AM



On 2009-08-03 06:03:25 -0700, Cerulean <Spamming (AT) NOTallowed (DOT) com> said:

Quote:
And if I can figure it out, if I have this right, a global field (?)
can capture a path the user browses to (??). Perhaps that's what I
can have, too, somehow.
No, that's not a feature of FM6. You can calculate a path and insert
the text into a global field, which you can then use with a plugin like
Troi File. But FM itself won't browse or capture the path. You have to
hard-code it or use Troi File to get the path.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA

Reply With Quote
  #5  
Old   
Cerulean
 
Posts: n/a

Default Re: "Set Variable" for FMP6? - 08-04-2009 , 04:30 PM



On Mon, 3 Aug 2009 08:31:13 -0700, Lynn Allen <lynn (AT) NOT-semiotics (DOT) com>
wrote:

Quote:
On 2009-08-03 06:03:25 -0700, Cerulean <Spamming (AT) NOTallowed (DOT) com> said:

And if I can figure it out, if I have this right, a global field (?)
can capture a path the user browses to (??). Perhaps that's what I
can have, too, somehow.

No, that's not a feature of FM6. You can calculate a path and insert
the text into a global field, which you can then use with a plugin like
Troi File. But FM itself won't browse or capture the path. You have to
hard-code it or use Troi File to get the path.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA
Thanks, I'm staying with hard coding it. I have no need for a ton of
new features so this one issue I'll have to live with. It's not the
end of the world, I just will have to remember to change the path iif
I open the file somewhere else to use, etc.

Cheers. D

Reply With Quote
  #6  
Old   
GSteven
 
Posts: n/a

Default Re: "Set Variable" for FMP6? - 09-23-2009 , 05:04 PM



A method that I've used that does not require a plugin is to store the old
path/file name and new path/file name to global fields (this takes some
forethought because the paths or names can contain no spaces). Afterwards I
concatenate the appropriate fields into a single field (in my system I name
this field "_DOScmd" and it is global) that contains a call to a batch file
to copy/rename/move the file.

Below is a copy of a batch file called "move.bat" that I use.

:: This file is named "move.bat" and is located in the "c:\batch_commands"
folder
:: it is designed to move (or rename) a file when called from Filemaker
:: The string built in Filemaker to call this batch file would be
:: c:\batch_commands\move.bat n:\tmp\test.txt n:\Reports\090923.txt
:: IMPORTANT - the only spaces allowed in the string above are the
separators between the command and the parameters
:: in this example we want to rename "test.txt" in the "n:\tmp" folder so
the new file name is 090923.txt and place it in n:\reports
:: There are 2 parameters passed to this batch file
:: The 1st (%1) is the path & filespec to the source file -
"n:\tmp\test.txt"
:: The 2nd (%2) is the path & filespec to the target file -
"n:\reports\090923.txt" NOTE: full path provided
:: the batch command to accomplish this is below
move %1 %2
:end

your script would look something like

export records - (specify the export to go to n:\tmp\test.txt)
set field _tmp01["c:\batch_commands\move.bat"]
set field _tmp02["n:\tmp\test.bat"]
set field _tmp03["n:\reports\090923.bat"]
set field _DOScmd[_tmp01 &" "& _tmp02 &" "& _tmp03]
send message[] - (specify from field and place _DOScmd in the step)

This works fairly well in non-critical solutions. The shortcoming is the
lack of error catching. You don't really know if the move was successful or
not. Ther may be a way to capture this but I've not had the opportunity to
find it.

"Cerulean" <Spamming (AT) NOTallowed (DOT) com> wrote

Quote:
On Mon, 3 Aug 2009 08:31:13 -0700, Lynn Allen <lynn (AT) NOT-semiotics (DOT) com
wrote:

On 2009-08-03 06:03:25 -0700, Cerulean <Spamming (AT) NOTallowed (DOT) com> said:

And if I can figure it out, if I have this right, a global field (?)
can capture a path the user browses to (??). Perhaps that's what I
can have, too, somehow.

No, that's not a feature of FM6. You can calculate a path and insert
the text into a global field, which you can then use with a plugin like
Troi File. But FM itself won't browse or capture the path. You have to
hard-code it or use Troi File to get the path.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA

Thanks, I'm staying with hard coding it. I have no need for a ton of
new features so this one issue I'll have to live with. It's not the
end of the world, I just will have to remember to change the path iif
I open the file somewhere else to use, etc.

Cheers. D

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.