dbTalk Databases Forums  

globals initialising

comp.databases.filemaker comp.databases.filemaker


Discuss globals initialising in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
thdyoung@googlemail.com
 
Posts: n/a

Default globals initialising - 06-21-2007 , 10:12 AM






possibly this question reveals great ignorance, so here goes...

are all global field reset to blank on opening up an FMP file ?

is there a script which will reset all global fields in a file, at one
fell swoop, to no value ?

marmot


Reply With Quote
  #2  
Old   
Matt WIlls
 
Posts: n/a

Default Re: globals initialising - 06-21-2007 , 11:27 AM






In article
<1182438760.177181.39830 (AT) u2g2000hsc (DOT) googlegroups.com>thdyoung@googlemai
l.com wrote:

Quote:
possibly this question reveals great ignorance, so here goes...
Not necessarily.

Quote:
are all global field reset to blank on opening up an FMP file ?
I think you can answer that pretty easily for yourself.

Open a file which contains global fields and observe the result.

Quote:
is there a script which will reset all global fields in a file, at
onefell swoop, to no value ?
I assume you mean "is there a script step..."

I suppose it is technically possible, but no.

Matt




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

Default Re: globals initialising - 06-21-2007 , 02:36 PM




"Matt WIlls" <Im (AT) Witz (DOT) End> schreef in bericht
news:nemoThu062107121101 (AT) news (DOT) verizon.net...
Quote:
In article
1182438760.177181.39830 (AT) u2g2000...oglegroups.com>thdyoung@googlemai
l.com wrote:

possibly this question reveals great ignorance, so here goes...

Not necessarily.

are all global field reset to blank on opening up an FMP file ?

I think you can answer that pretty easily for yourself.

Open a file which contains global fields and observe the result.

is there a script which will reset all global fields in a file, at
onefell swoop, to no value ?

I assume you mean "is there a script step..."

I suppose it is technically possible, but no.

Matt


Not only technychalli possible. I have done it in the past.

Ursus




Reply With Quote
  #4  
Old   
thdyoung@googlemail.com
 
Posts: n/a

Default Re: globals initialising - 06-21-2007 , 02:55 PM



On Jun 21, 8:36 pm, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:
Quote:
"Matt WIlls" <I... (AT) Witz (DOT) End> schreef in berichtnews:nemoThu062107121101 (AT) news (DOT) verizon.net...



In article
1182438760.177181.39... (AT) u2g2000hsc (DOT) googlegroups.com>thdyoung@googlemai
l.com wrote:

possibly this question reveals great ignorance, so here goes...

Not necessarily.

are all global field reset to blank on opening up an FMP file ?

I think you can answer that pretty easily for yourself.

Open a file which contains global fields and observe the result.

is there a script which will reset all global fields in a file, at
onefell swoop, to no value ?

I assume you mean "is there a script step..."

I suppose it is technically possible, but no.

Matt

Not only technychalli possible. I have done it in the past.

Ursus
thanks Matt for pointing to the DIY answer to my question: good point!
The expert view helps, nevertheless.

Ursus, is the technychalli possible thing easily done or not ? And
please divulge something more about the method.

Marmot



Reply With Quote
  #5  
Old   
Helpful Harry
 
Posts: n/a

Default Re: globals initialising - 06-21-2007 , 03:51 PM



In article <1182438760.177181.39830 (AT) u2g2000hsc (DOT) googlegroups.com>,
thdyoung (AT) googlemail (DOT) com wrote:

Quote:
possibly this question reveals great ignorance, so here goes...

are all global field reset to blank on opening up an FMP file ?

is there a script which will reset all global fields in a file, at one
fell swoop, to no value ?
The data in Global fields is saved when the file is closed ... unless
you are connecting to a file hosted by another computer / server (in
which case only the Global field changes made by the host computer are
saved).


The only way I know of to wipe the content of all Global fields in one
go is to use the Save A Copy As Clone option. That creates a COPY of
the file with NO data at all, so you would then have to import the
normal record data from the original file, delete / rename the original
file, and then rename the new copy to the original file's name.

A better way is to have an Opening or Closing script that uses Set
Field commands to empty the Global fields.
ie.
Set Field [g_GlobalField1, ""]
Set Field [g_GlobalField2, ""]
Set Field [g_GlobalField3, ""]
etc.

An easier way if there are LOTS of Global fields you want to empty
might be to use a separate file / table to store the "global" data as a
normal record data (with relationships to let you access the data) and
then simply have the Opening / Closing script delete that record.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


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

Default Re: globals initialising - 06-21-2007 , 04:39 PM



On Jun 21, 9:12 am, thdyo... (AT) googlemail (DOT) com wrote:
Quote:
possibly this question reveals great ignorance, so here goes...

are all global field reset to blank on opening up an FMP file ?

is there a script which will reset all global fields in a file, at one
fell swoop, to no value ?

marmot
You'll need a script and set it to run when the file is closed. One
of the great weaknesses of Filemaker these days is the inability to
Set Field by calculation, which would make this process pretty
intuitive. Alas, here's what I would do.

Put all your globals on one layout and write a script that goes
something like this:

Set Variable[$fields; ValueCount(FieldNames(Get(FileName); "Globals"))
Go to Field
Loop
Set Field [""]
Set Variable[$counter;$counter+1]
Exit Loop If [$counter = $fields]
Go to Next Field
End Loop

If you ever have a new global, just make sure to put it on that
layout. When you delete a global, it'll come off automatically.




Reply With Quote
  #7  
Old   
Matt WIlls
 
Posts: n/a

Default Re: globals initialising - 06-21-2007 , 05:01 PM



In article <467ad33e$0$292$dbd4d001 (AT) news (DOT) wanadoo.nl>
"Ursus"<ursus.kirk (AT) wanadoo (DOT) nl> wrote:

Quote:
"Matt WIlls" <Im (AT) Witz (DOT) End> schreef in bericht
news:nemoThu062107121101 (AT) news (DOT) verizon.net...
In article


1182438760.177181.39830 (AT) u2g2000...oglegroups.com>thdyoung@googlem
ai l.com wrote:

possibly this question reveals great ignorance, so here goes...

Not necessarily.

are all global field reset to blank on opening up an FMP file ?

I think you can answer that pretty easily for yourself.

Open a file which contains global fields and observe the result.

is there a script which will reset all global fields in a file,
at onefell swoop, to no value ?

I assume you mean "is there a script step..."

I suppose it is technically possible, but no.

Matt



Not only technychalli possible. I have done it in the past.

Ursus
I'm sayng that it would be technically possible for FileMaker to give
us a script step to Clear All Globals in one shot. There are several
ways to do it otherwise.
A workaround might

1. Script setting each global field to null. The worst part is doing
the script for the first time; after that, add new fields as necessary.
2. Save the file as a clone and re-import everything but the globals,
which uncovers a new set of pitfalls, depending on the situation.
3. Import a text file full of null values into the globals, then
delete the new records. Any auto-entered values might get messed up.
That's all I have.

Matt













Reply With Quote
  #8  
Old   
Ursus
 
Posts: n/a

Default Re: globals initialising - 06-22-2007 , 05:49 AM




<thdyoung (AT) googlemail (DOT) com> schreef in bericht
news:1182455751.932251.33560 (AT) o61g2000hsh (DOT) googlegroups.com...
Quote:
On Jun 21, 8:36 pm, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:
"Matt WIlls" <I... (AT) Witz (DOT) End> schreef in
berichtnews:nemoThu062107121101 (AT) news (DOT) verizon.net...



In article
1182438760.177181.39... (AT) u2g2000hsc (DOT) googlegroups.com>thdyoung@googlemai
l.com wrote:

possibly this question reveals great ignorance, so here goes...

Not necessarily.

are all global field reset to blank on opening up an FMP file ?

I think you can answer that pretty easily for yourself.

Open a file which contains global fields and observe the result.

is there a script which will reset all global fields in a file, at
onefell swoop, to no value ?

I assume you mean "is there a script step..."

I suppose it is technically possible, but no.

Matt

Not only technychalli possible. I have done it in the past.

Ursus

thanks Matt for pointing to the DIY answer to my question: good point!
The expert view helps, nevertheless.

Ursus, is the technychalli possible thing easily done or not ? And
please divulge something more about the method.

Marmot

You may already have read about massive scripts that will set the global
field back to their initial state. A simpler way may be used when the
globals are never reset with a new value. They are never changed along the
way.

Create a global textfield
set it to auto-enter its contents by calculation

gMyGlobal < Text ; auto-enter Calculation replaces existing value ; If (
IsEmpty (gMyGlobal) ; "Value" ; "Value") >

Whatever happens to the field, it will contain the string "Value", even
after a clone or an export.

Keep well, Ursus




Reply With Quote
  #9  
Old   
Grip
 
Posts: n/a

Default Re: globals initialising - 06-22-2007 , 11:47 AM



On Jun 22, 4:49 am, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:
Quote:
thdyo... (AT) googlemail (DOT) com> schreef in berichtnews:1182455751.932251.33560 (AT) o61g2000hsh (DOT) googlegroups.com...



On Jun 21, 8:36 pm, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:
"Matt WIlls" <I... (AT) Witz (DOT) End> schreef in
berichtnews:nemoThu062107121101 (AT) news (DOT) verizon.net...

In article
1182438760.177181.39... (AT) u2g2000hsc (DOT) googlegroups.com>thdyoung@googlemai
l.com wrote:

possibly this question reveals great ignorance, so here goes...

Not necessarily.

are all global field reset to blank on opening up an FMP file ?

I think you can answer that pretty easily for yourself.

Open a file which contains global fields and observe the result.

is there a script which will reset all global fields in a file, at
onefell swoop, to no value ?

I assume you mean "is there a script step..."

I suppose it is technically possible, but no.

Matt

Not only technychalli possible. I have done it in the past.

Ursus

thanks Matt for pointing to the DIY answer to my question: good point!
The expert view helps, nevertheless.

Ursus, is the technychalli possible thing easily done or not ? And
please divulge something more about the method.

Marmot

You may already have read about massive scripts that will set the global
field back to their initial state. A simpler way may be used when the
globals are never reset with a new value. They are never changed along the
way.

Create a global textfield
set it to auto-enter its contents by calculation

gMyGlobal < Text ; auto-enter Calculation replaces existing value ; If (
IsEmpty (gMyGlobal) ; "Value" ; "Value")

Whatever happens to the field, it will contain the string "Value", even
after a clone or an export.

Keep well, Ursus
If the field never changes, wouldn't a making the field a global
calculation = "Value" be simpler?

G



Reply With Quote
  #10  
Old   
Helpful Harry
 
Posts: n/a

Default Re: globals initialising - 06-22-2007 , 06:00 PM



In article <1182530874.950173.225760 (AT) n60g2000hse (DOT) googlegroups.com>,
Grip <grip (AT) cybermesa (DOT) com> wrote:

Quote:
On Jun 22, 4:49 am, "Ursus" <ursus.k... (AT) wanadoo (DOT) nl> wrote:

You may already have read about massive scripts that will set the global
field back to their initial state.
I like Grip's (I think it was?) script that tabs through the fields.
I'm not sure whether it might be slower than a series of Set Field
commands, but it is certainly easier to set-up. Using a Freeze Window
command might help speed it up a little.



Quote:
A simpler way may be used when the
globals are never reset with a new value. They are never changed along the
way.

Create a global textfield
set it to auto-enter its contents by calculation

gMyGlobal < Text ; auto-enter Calculation replaces existing value ; If (
IsEmpty (gMyGlobal) ; "Value" ; "Value")

Whatever happens to the field, it will contain the string "Value", even
after a clone or an export.

If the field never changes, wouldn't a making the field a global
calculation = "Value" be simpler?
A note for those of us still using older versions of FileMaker: you can
not have Global fields that use an Auto-enter Calculation or are a
Calculation - in the older versions Global fields are the normal simple
field types (Text, Number, Date, etc.)

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


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.