dbTalk Databases Forums  

FM8 Script Variable

comp.databases.filemaker comp.databases.filemaker


Discuss FM8 Script Variable in the comp.databases.filemaker forum.



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

Default FM8 Script Variable - 09-04-2005 , 08:03 AM






Gulp!

At last - script variables!! But am I right to be astonished that the
calculation result fort script variablkes can only be text, so that
for example if using a script variable as a loop counter the simple
Set Variable ($LoopCount=$LoopCount+1) doesn't increment the value of
LoopCount!

I am not sure about this, but, am I correct in thinking that the way
to deal with this is: Set Variable ($LoopCount=Evaluate($LoopCount+1))
?

Mike

Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: FM8 Script Variable - 09-04-2005 , 11:04 AM






$LoopCount=$LoopCount+1 works fine for me

blag wrote:
Quote:
Gulp!

At last - script variables!! But am I right to be astonished that the
calculation result fort script variablkes can only be text, so that
for example if using a script variable as a loop counter the simple
Set Variable ($LoopCount=$LoopCount+1) doesn't increment the value of
LoopCount!

I am not sure about this, but, am I correct in thinking that the way
to deal with this is: Set Variable ($LoopCount=Evaluate($LoopCount+1))
?

Mike
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


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

Default Re: FM8 Script Variable - 09-05-2005 , 03:17 AM



Howard

I have double-checked and it doesn't work for me!!

I wonder what is going on? (I am running FMPro 8 on Windows XP.)

Mike

On Sun, 04 Sep 2005 09:04:17 -0700, Howard Schlossberg
<howard (AT) antispahm (DOT) fmprosolutions.com> wrote:

Quote:
$LoopCount=$LoopCount+1 works fine for me

blag wrote:
Gulp!

At last - script variables!! But am I right to be astonished that the
calculation result fort script variablkes can only be text, so that
for example if using a script variable as a loop counter the simple
Set Variable ($LoopCount=$LoopCount+1) doesn't increment the value of
LoopCount!

I am not sure about this, but, am I correct in thinking that the way
to deal with this is: Set Variable ($LoopCount=Evaluate($LoopCount+1))
?

Mike


Reply With Quote
  #4  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: FM8 Script Variable - 09-05-2005 , 12:08 PM



Today's a holiday in the States, so I'm at home. And I forgot to
install FM8 here at home before I brought all my disks into the office.
I'll give it another try tomorrow.


blag wrote:
Quote:
I have double-checked and it doesn't work for me!!

I wonder what is going on? (I am running FMPro 8 on Windows XP.)

Mike

On Sun, 04 Sep 2005 09:04:17 -0700, Howard Schlossberg
howard (AT) antispahm (DOT) fmprosolutions.com> wrote:

$LoopCount=$LoopCount+1 works fine for me
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #5  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: FM8 Script Variable - 09-05-2005 , 10:03 PM



I just ran the following script and it ended with the 'Text' field being
'11' (which is correct). Can you post a sample of your script? You
understand that a variable starting with $ is local to the script in
which it runs, and $$ is global across multiple scripts and files, and
once the script is over $LoopCount will be '0'...right?

Loop
Set Variable [ $LoopCount; Value:$LoopCount + 1 ]
Exit Loop If [ $LoopCount > 10 ]
End Loop
Set Field [ Table::text; $LoopCount ]


Quote:
blag wrote:

I have double-checked and it doesn't work for me!!

I wonder what is going on? (I am running FMPro 8 on Windows XP.)

Mike

On Sun, 04 Sep 2005 09:04:17 -0700, Howard Schlossberg
howard (AT) antispahm (DOT) fmprosolutions.com> wrote:

$LoopCount=$LoopCount+1 works fine for me


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


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

Default Re: FM8 Script Variable - 09-06-2005 , 03:19 AM



Howard

I regret that I can't post the script, because I have now been through
all the scripts and have included an Evaluate function in all the
occurrences of LoopCount increment! I wil, however, try to use it in a
new script and see how things go.

Interestingly I also discovered that the another script, which works
fine in 7 doesn't work in 8! (Other users beware!)

A scipt step Set Field(sel::Num sel;Count (Sel job no Dwgs::UserID)
gives a ? result for sel::Num sel in the data viewer, which of course
causes the script to fail

Is it that the data viewer is not giving the true status of
variables/fields? I don't think so, because, other values seem to
behave correctly in the data viewer!!

Is your Table::text field a text field? (Not that it should make any
difference, because you are finding that the increment works, whereas
I have found it doesn't)

BTW I understand the difference between global and local variables.

Am I right in thinking that 8 remmbers printers? 7 seemed to always
revert to the default printer, whereas I am now findng that my
databases now seem to know what printer is to be used, even though
they (so far as I can tell) don't remember the page size.

Mike

On Mon, 05 Sep 2005 20:03:48 -0700, Howard Schlossberg
<howard (AT) antispahm (DOT) fmprosolutions.com> wrote:

Quote:
I just ran the following script and it ended with the 'Text' field being
'11' (which is correct). Can you post a sample of your script? You
understand that a variable starting with $ is local to the script in
which it runs, and $$ is global across multiple scripts and files, and
once the script is over $LoopCount will be '0'...right?

Loop
Set Variable [ $LoopCount; Value:$LoopCount + 1 ]
Exit Loop If [ $LoopCount > 10 ]
End Loop
Set Field [ Table::text; $LoopCount ]


blag wrote:

I have double-checked and it doesn't work for me!!

I wonder what is going on? (I am running FMPro 8 on Windows XP.)

Mike

On Sun, 04 Sep 2005 09:04:17 -0700, Howard Schlossberg
howard (AT) antispahm (DOT) fmprosolutions.com> wrote:

$LoopCount=$LoopCount+1 works fine for me




Reply With Quote
  #7  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: FM8 Script Variable - 09-06-2005 , 11:49 AM



blag wrote:

Quote:
Interestingly I also discovered that the another script, which works
fine in 7 doesn't work in 8! (Other users beware!)

A scipt step Set Field(sel::Num sel;Count (Sel job no Dwgs::UserID)
gives a ? result for sel::Num sel in the data viewer, which of course
causes the script to fail
This sounds like something I have reported to FileMaker on a couple
occassions, but that shouldn't stop you from also reporting it as an
issue <http://filemaker.com/company/product/problems.html>.

What I have found is that such a script step now depends on the context
of the active layout object. If you are in one of the layout fields (or
not in the record at all), then behavior is as it always was: the
count() would be that of the related records.

But if you have your cursor in a portal field or one of the portal rows
is active, then the count() will evaluate from the point of view of the
portal record. If you have the cursor in a field of the "Sel job no
Dwgs" relationship, then the new FM8 behavior has it count how many of
itself there are. Of course, you and I would think the result of even
that should be '1' (itself), but FM8 returns '?'.

If not a bug, then I at least see this as unexpected and/or undesirable
behavior. Please report it.

Quote:
Is your Table::text field a text field? (Not that it should make any
difference, because you are finding that the increment works, whereas
I have found it doesn't)
Yep -- I used a text field just to show that not only did the Set
Variable work, but it even worked when being set into a text field.

Quote:
Am I right in thinking that 8 remmbers printers? 7 seemed to always
revert to the default printer, whereas I am now findng that my
databases now seem to know what printer is to be used, even though
they (so far as I can tell) don't remember the page size.
I haven't tried printer settings on FM8. In 7, I didn't have problems
with it remembering the printer on a particular machine. But I found
that I had to go to all machines that would be running that script and
reset the print settings in the script on each of those machines
separately. Once this was done, it seemed to hold properly on all machines.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


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.