Normal Topic Proof read help (Read 978 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Proof read help
Nov 1st, 2007 at 6:08pm
Print Post Print Post  
Hello All

Need some help proofing some code.......that works up to 8 times then stops working. (That is, the navigation part stops working)
open to any suggestions and thanks for looking

my code looks like this

/* Move to the Next record in the set, If there is one. If Updating, this will save
the current record and move on.  If Adding records, this will save the current
record and move to a new form. select the Menu Tree Item based on where you currently
are in the application */

Var vNav as Int

If @mode()=1 and @ResultSetCurrentPosition() <> @ResultSetTotal()
     {
           If (Status = "Complete") or (Status = "Received") and (Not @ServerDate() >= (odate + 45))
                 {
                       If (Not @IsBlank(brp1)) and (@IsBlank(P1))
                       or (Not @IsBlank(brp2)) and (@IsBlank(P2)) 
                       or (Not @IsBlank(brp3)) and (@IsBlank(P3))
                       or (Not @IsBlank(brp4)) and (@IsBlank(P4))
                       or (Not @IsBlank(brp5)) and (@IsBlank(P5))
                       or (Not @IsBlank(brp6)) and (@IsBlank(P6))
                       or (Not @IsBlank(brp7)) and (@IsBlank(P7))
                       or (Not @IsBlank(brp8)) and (@IsBlank(P8))
                       or (Not @IsBlank(brp9)) and (@IsBlank(P9))
                       or (Not @IsBlank(brp10)) and (@IsBlank(P10))
                       or (Not @IsBlank(brp11)) and (@IsBlank(P11))
                       or (Not @IsBlank(brp12)) and (@IsBlank(P12))
                       or (Not @IsBlank(brp13)) and (@IsBlank(P13))
                       or (Not @IsBlank(brp14)) and (@IsBlank(P14))
                           or (Not @IsBlank(brp15)) and (@IsBlank(P15))
                       or (Not @IsBlank(brp16)) and (@IsBlank(P16))
                       or (Not @IsBlank(brp17)) and (@IsBlank(P17))
                       or (Not @IsBlank(brp18)) and (@IsBlank(P18))
                       or (Not @IsBlank(brp19)) and (@IsBlank(P19))
                       or (Not @IsBlank(brp20)) and (@IsBlank(P20))
                             {
                                   OPost()
                                   FormCommit("")
                                   vNav = @SelectTreeItem("Search Update Menu!Navigation!Advance Record (F10)")
                             }
                 }                  
           Else
                 {
                       vNav = @SelectTreeItem("Search Update Menu!Navigation!Advance Record (F10)")
                 }
     }

Else If @mode()=1 and @ResultSetCurrentPosition() = @ResultSetTotal()
     {
           ThrowFocus(oName)
           @Msg("There are No More Records In This Set")
     }
Else If @Mode()=0
     {
           If (Status = "Complete") or (Status = "Received") and (Not @ServerDate() >= (odate + 45))
                 {
                       If (Not @IsBlank(brp1)) and (@IsBlank(P1))
                       or (Not @IsBlank(brp2)) and (@IsBlank(P2)) 
                       or (Not @IsBlank(brp3)) and (@IsBlank(P3))
                       or (Not @IsBlank(brp4)) and (@IsBlank(P4))
                       or (Not @IsBlank(brp5)) and (@IsBlank(P5))
                       or (Not @IsBlank(brp6)) and (@IsBlank(P6))
                       or (Not @IsBlank(brp7)) and (@IsBlank(P7))
                       or (Not @IsBlank(brp8)) and (@IsBlank(P8))
                       or (Not @IsBlank(brp9)) and (@IsBlank(P9))
                       or (Not @IsBlank(brp10)) and (@IsBlank(P10))
                       or (Not @IsBlank(brp11)) and (@IsBlank(P11))
                       or (Not @IsBlank(brp12)) and (@IsBlank(P12))
                       or (Not @IsBlank(brp13)) and (@IsBlank(P13))
                       or (Not @IsBlank(brp14)) and (@IsBlank(P14))
                       or (Not @IsBlank(brp15)) and (@IsBlank(P15))
                       or (Not @IsBlank(brp16)) and (@IsBlank(P16))
                       or (Not @IsBlank(brp17)) and (@IsBlank(P17))
                       or (Not @IsBlank(brp18)) and (@IsBlank(P18))
                       or (Not @IsBlank(brp19)) and (@IsBlank(P19))
                       or (Not @IsBlank(brp20)) and (@IsBlank(P20))
                             {
                                   OPost()
                                   FormCommit("")
                                   vNav = @SelectTreeItem("Add Data Menu!Navigation!Advance Record (F10)")
                             }
                 }
           Else
                 {
                       vNav = @SelectTreeItem("Add Data Menu!Navigation!Advance Record (F10)")
                 }
     }
vNav = ""

ThrowFocus(oName)


The subroutines are ok  I removed them all and had the same effect.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Proof read help
Reply #1 - Nov 1st, 2007 at 8:03pm
Print Post Print Post  
Found It!!

Not enough parenthesizes around all of the ... or (Not @IsBlank(brp2)) and (@IsBlank(P2))
should be  ... or ((Not @IsBlank(brp2)) and (@IsBlank(P2)))

only three days worth of frustration. 

Still, If you see room for improvements I would like to hear it!
Thank you all
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Proof read help
Reply #2 - Nov 1st, 2007 at 10:22pm
Print Post Print Post  
Quote:
only three days worth of frustration.

I can sympathize.  Parenthetical logic drives me batty.
  

**
Captain Infinity
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Proof read help
Reply #3 - Nov 2nd, 2007 at 6:31am
Print Post Print Post  
Replace all of the "brp"nn and "P"nn lines with "brp" and "P" + vCounter and loop through them using vCounter


Code
Select All
var vCounter as Int
vCounter = 0

While (vCounter < 21) {
     vCounter += 1
     If (Not @IsBlank("brp" + vCounter)) and (@IsBlank("P"+ vCounter))
     } 



This is untested, thrown together to give you an idea.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Proof read help
Reply #4 - Nov 2nd, 2007 at 11:22am
Print Post Print Post  
Bob,

FYI: Above won't work. @IsBlank takes an element reference, not a string. You'd have to use @Field instead of @IsBlank to do something like what you describe.
« Last Edit: Nov 2nd, 2007 at 1:11pm by Hammer »  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Proof read help
Reply #5 - Nov 2nd, 2007 at 2:05pm
Print Post Print Post  
Thank you Bob & Erika for the ideas, I will give them a try this weekend and let you know how it works!
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Proof read help
Reply #6 - Nov 3rd, 2007 at 4:53pm
Print Post Print Post  
You're right Erika.

I was just concentrating on the string and used the rest of the codes from the provided problem.
Will have to see how FlipGilbert makes out.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: Proof read help
Reply #7 - Nov 6th, 2007 at 6:43pm
Print Post Print Post  
the long code is working good, I think I'm going to save this project for a later time.

Too many changes to a layout at on time makes it harder to find "Discrepancies" that pop up weeks after you made them.

Thank you all for your support!
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged