Re: Sequential Code Logic

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 53995
interpreted = N
texte = Clint, Nice looking code! I always like to see well formatted code. I was wondering if treating the number fields like text would give you problems?? Are the text values of numbers always sequentially the same as the number value of numbers? Donovan Clint Davis wrote: > It always amazes me how difficult it is to code some logic that the human > mind has no trouble with. Anyway, I figured out a solution, so I thought I > post it for the archives. > > > [!]----- Calculate the last deed number -----[/!] > [search db=admin/deed_number.db&neIDdatarq=find_all&deIDsort=1&max=1] > [founditems] > [text]theTract=[TRACT][/text] > [text]theSub=[SUB][/text] > [text]theSquare=[SQUARE][/text] > [text]theBlock=[BLOCK][/text] > [text]theLot=[LOT][/text] > [/founditems] > [/search] > > [!]----- Roll sections over if they've reached their max -----[/!] > [if "[theLot]"="999"] > [then] > [text]newLot=1[/text] > [/then] > [else] > [text]newLot=[math][theLot]+1[/math][/text] > [text]newBlock=[theBlock][/text] > [/else] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99")] > [then] > [text]newBlock=1[/text] > [/then] > [else] > [text]newSquare=[theSquare][/text] > [/else] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"="D")] > [then] > [text]newSquare=A[/text] > [/then] > [else] > [text]newSub=[theSub][/text] > [/else] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"="D") & > ("[theSub]"="99")] > [then] > [text]newSub=1[/text] > [text]newTract=[math][theTract]+1[/math][/text] > [/then] > [else] > [text]newTract=[theTract][/text] > [/else] > [/if] > > [!]----- Increase sections by one where needed -----[/!] > [if ("[theLot]"="999") & ("[theBlock]"!"99")] > [then] > [text]newBlock=[math][theBlock]+1[/math][/text] > [/then] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"!"D")] > [then] > [switch value=[theSquare]] > [case value=A] > [text]newSquare=B[/text] > [/case] > [case value=B] > [text]newSquare=C[/text] > [/case] > [case value=C] > [text]newSquare=D[/text] > [/case] > [case value=D] > [text]newSquare=A[/text] > [/case] > [/switch] > [/then] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"="D") & > ("[theSub]"!"99")] > [then] > [text]newSub=[math][theSub]+1[/math][/text] > [/then] > [/if] > > > > On 11/12/03 8:58 AM, "Clint Davis" wrote: > > >>A store I'm building will be selling an item that is serialized with a >>sequential code like this: >> >>1 1 A 1 1 >>1 1 A 1 2 >>... >>1 1 A 1 99 >>1 1 A 2 1 >>... >>1 1 A 99 99 >>1 1 B 1 1 >>... >>1 1 D 99 99 >>1 2 A 1 1 >>... >>1 99 D 99 99 >>2 1 A 1 1 >> >> >>Field 1 = 1-99 >>Field 2 = 1-99 >>Field 3 = A-D >>Field 4 = 1-99 >>Field 5 = 1-99 > > > > --------------------------------------------------------------------- > Clint Davis > Webmaster / Interactive Media Specialist > Gray Loon Marketing Group, Inc. http://www.grayloon.com > 204 Main Street | Evansville, IN 47708 | Phone:812-422-9999 > --------------------------------------------------------------------- -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design WWW Developer / Consultant <-Web Development (specializing in eCommerce), -> <-Graphic Design, and Pre-Press Consultation -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 email:> dbrooke(AT)euca.us Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Sequential Code Logic ( Donovan Brooke 2003)
  2. Re: Sequential Code Logic ( Clint Davis 2003)
  3. Re: Sequential Code Logic ( "Jan Donald" 2003)
  4. Re: Sequential Code Logic ( "Andrew Simpson" 2003)
  5. Re: Sequential Code Logic ( Donovan Brooke 2003)
  6. Re: Sequential Code Logic ( Gary Krockover 2003)
  7. Re: Sequential Code Logic ( Clint Davis 2003)
  8. Sequential Code Logic ( Clint Davis 2003)
Clint, Nice looking code! I always like to see well formatted code. I was wondering if treating the number fields like text would give you problems?? Are the text values of numbers always sequentially the same as the number value of numbers? Donovan Clint Davis wrote: > It always amazes me how difficult it is to code some logic that the human > mind has no trouble with. Anyway, I figured out a solution, so I thought I > post it for the archives. > > > [!]----- Calculate the last deed number -----[/!] > [search db=admin/deed_number.db&neIDdatarq=find_all&deIDsort=1&max=1] > [founditems] > [text]theTract=[TRACT][/text] > [text]theSub=[SUB][/text] > [text]theSquare=[SQUARE][/text] > [text]theBlock=[BLOCK][/text] > [text]theLot=[LOT][/text] > [/founditems] > [/search] > > [!]----- Roll sections over if they've reached their max -----[/!] > [if "[theLot]"="999"] > [then] > [text]newLot=1[/text] > [/then] > [else] > [text]newLot=[math][theLot]+1[/math][/text] > [text]newBlock=[theBlock][/text] > [/else] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99")] > [then] > [text]newBlock=1[/text] > [/then] > [else] > [text]newSquare=[theSquare][/text] > [/else] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"="D")] > [then] > [text]newSquare=A[/text] > [/then] > [else] > [text]newSub=[theSub][/text] > [/else] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"="D") & > ("[theSub]"="99")] > [then] > [text]newSub=1[/text] > [text]newTract=[math][theTract]+1[/math][/text] > [/then] > [else] > [text]newTract=[theTract][/text] > [/else] > [/if] > > [!]----- Increase sections by one where needed -----[/!] > [if ("[theLot]"="999") & ("[theBlock]"!"99")] > [then] > [text]newBlock=[math][theBlock]+1[/math][/text] > [/then] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"!"D")] > [then] > [switch value=[theSquare]] > [case value=A] > [text]newSquare=B[/text] > [/case] > [case value=B] > [text]newSquare=C[/text] > [/case] > [case value=C] > [text]newSquare=D[/text] > [/case] > [case value=D] > [text]newSquare=A[/text] > [/case] > [/switch] > [/then] > [/if] > [if ("[theLot]"="999") & ("[theBlock]"="99") & ("[theSquare]"="D") & > ("[theSub]"!"99")] > [then] > [text]newSub=[math][theSub]+1[/math][/text] > [/then] > [/if] > > > > On 11/12/03 8:58 AM, "Clint Davis" wrote: > > >>A store I'm building will be selling an item that is serialized with a >>sequential code like this: >> >>1 1 A 1 1 >>1 1 A 1 2 >>... >>1 1 A 1 99 >>1 1 A 2 1 >>... >>1 1 A 99 99 >>1 1 B 1 1 >>... >>1 1 D 99 99 >>1 2 A 1 1 >>... >>1 99 D 99 99 >>2 1 A 1 1 >> >> >>Field 1 = 1-99 >>Field 2 = 1-99 >>Field 3 = A-D >>Field 4 = 1-99 >>Field 5 = 1-99 > > > > --------------------------------------------------------------------- > Clint Davis > Webmaster / Interactive Media Specialist > Gray Loon Marketing Group, Inc. http://www.grayloon.com > 204 Main Street | Evansville, IN 47708 | Phone:812-422-9999 > --------------------------------------------------------------------- -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design WWW Developer / Consultant <-Web Development (specializing in eCommerce), -> <-Graphic Design, and Pre-Press Consultation -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 email:> dbrooke(AT)euca.us Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Donovan Brooke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Help! WebCat2 bug (1997) Problems with [Applescript] (1997) question: writing files textb in webmerch (1997) Associative lookup style? + bit more (1997) One .hdr, multiple .db's? (2003) Group search doesn't work. (1997) [OT] What log analyzer do you use? (2000) Url encoded fun (1998) cart info (1998) Nested tags count question (1997) WebCatb15 Mac CGI -- [purchase] (1997) Price Not Appearing (2000) [WebDNA] remove html comments (2009) Sku numbers (1997) Shipping charges based on dollar level (1997) [WebDNA] Problem with administration (2009) Advanced WebCat Guidelines - do they exist beyond docs (1999) [SHOWIF] (1997) [SQL Connect] (2007) E-mailer error codes (1997)