dbTalk Databases Forums  

changevalue and newvalue

comp.databases.paradox comp.databases.paradox


Discuss changevalue and newvalue in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #71  
Old   
Jeff Shoaf
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 04:10 PM






You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
Quote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf

Reply With Quote
  #72  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM






Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


Reply With Quote
  #73  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM



Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


Reply With Quote
  #74  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM



Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


Reply With Quote
  #75  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM



Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


Reply With Quote
  #76  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM



Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


Reply With Quote
  #77  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM



Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


Reply With Quote
  #78  
Old   
Bill McCray
 
Posts: n/a

Default Re: changevalue and newvalue - 06-08-2008 , 05:11 PM



Yes. I forgot to mention initializing it in Init(). Thanks.

Bill

On Sun, 08 Jun 2008 17:10:02 -0400, Jeff Shoaf <jeffshoaf (AT) alltel (DOT) net>
wrote:

Quote:
You're right - if you declare the flag at the form level, it keeps it's
value as long as the form is open. I tend to put one-shots near the code
where they're used so they're obvious.

Still, if declared at the form level, you need to be sure to give it a
value before trying to read it. I'd probably set it to false in the
form's init() event.

Jim Hargan wrote:
IOW, declare the logical flag variable in the var method of the form (or
some other object in the containership hierarchy between the field and the
form).

And (just a suggestion here) call it
var
gloFlag logical
endvar
with "glo" meaning "global logical". Now you (or your successor) will
always know its data type and where it's been declared!

I like this solution, and have used it a number of times -- but I now
consider it a fudge, and instead look for the cause of the event firing
when I don't want it to. When I have time, that is.

--
Jim Hargan

On Sun, 08 Jun 2008 09:36:02 -0400, Jeff Shoaf wrote:

I've always called this type of construct a "one-shot" - maybe due to my
electronics background.

Note that the var declaration needs to be placed above the event
declaration or it will be cleared each time the event runs. Also note
that you need to check to see if it's been assigned a value before
checking the value or you'll get an unassigned variable error.

var
flag logical
endVar

ChangeValue() ; This is the first line of code that's automatically
; created by Paradox - I can't remember the full line

if not flag.isAssigned() then
flag = false
endIf

if not flag then
flag = true
; your code
flag = false
endIf


Bill McCray wrote:
If you are concerned about changes leading to back and forth
triggering, define a Logical variable in the Var section for each
field. Let's call it "Flag". Use Flag to avoid repeating an
operation.

If Not Flag Then
Flag = True
; Put your changes here
Flag = False
EndIf
----------------------------------------------------------------
Reverse parts of the user name and ISP name for my e-address


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.