Re: Sequential Code Logic
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54012
interpreted = N
texte = Dear AndrewI just wanted help installing my SmithMicro cameraThanks for your timeJanna>From: "Andrew Simpson"
>Reply-To: (WebDNA Talk)>To: (WebDNA Talk)>Subject: Re: Sequential Code Logic>Date: Thu, 13 Nov 2003 07:55:40 +1300>>i would have just created a database with ALL the possible combinations, >Primary Index'd with a counter that went from 1->100,000 or however many >there are and one last field called USED=T/F>>then just select the next un-used combination from the database each time >you need one, ordered by the ID>>creating the database would have been pretty easy.>>[loop start=1&end=99]>[loop start=1&end=99]>[loop start=1&end=99]>[loop start=1&end=99]>[loop start=1&end=99]> [apend db....>[/loop]>[/loop]>[/loop]>[/loop]>[/loop]>>i love coding stuff that makes webcat work :-)>>ssssh... don't tell alain... ;-)>>> > 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> > ---------------------------------------------------------------------> >> >> > -------------------------------------------------------------> > 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/>>>------------------------------------------------------------->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/_________________________________________________________________Compare high-speed Internet plans, starting at $26.95. https://broadband.msn.com (Prices may vary by service area.)-------------------------------------------------------------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:
Dear AndrewI just wanted help installing my SmithMicro cameraThanks for your timeJanna>From: "Andrew Simpson" >Reply-To: (WebDNA Talk)>To: (WebDNA Talk)>Subject: Re: Sequential Code Logic>Date: Thu, 13 Nov 2003 07:55:40 +1300>>i would have just created a database with ALL the possible combinations, >Primary Index'd with a counter that went from 1->100,000 or however many >there are and one last field called USED=T/F>>then just select the next un-used combination from the database each time >you need one, ordered by the ID>>creating the database would have been pretty easy.>>[loop start=1&end=99]>[loop start=1&end=99]>[loop start=1&end=99]>[loop start=1&end=99]>[loop start=1&end=99]> [apend db....>[/loop]>[/loop]>[/loop]>[/loop]>[/loop]>>i love coding stuff that makes webcat work :-)>>ssssh... don't tell alain... ;-)>>> > 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> > ---------------------------------------------------------------------> >> >> > -------------------------------------------------------------> > 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/>>>------------------------------------------------------------->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/_________________________________________________________________Compare high-speed Internet plans, starting at $26.95. https://broadband.msn.com (Prices may vary by service area.)-------------------------------------------------------------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/
"Jan Donald"
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:
how do I have html files routed through webcat on OSX? (2001)
WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997)
Nested tags count question (1997)
How to redirect based on price subtotal? (1998)
IIS4/IIS3 and WebCatalog registry settings (1998)
Problems reading files created by WC (1997)
[WebDNA] An unknown error occured // Deadlock avoided (2011)
WebMerchant Only reads 1.4 order files error (1997)
[WebDNA] read database from other domain (2015)
[OT] FTP client (2003)
WebCat and image maps (1997)
Missing contexts on NT (1997)
Join us at MacWorld! - Part 2 (1998)
PCS Frames (1997)
form posts expiring instantly... why? (2000)
Security & Query Strings (2004)
All choices on IE different than Netscape (1997)
WebCat2b13MacPlugIn - [shownext method=post] ??? (1997)
creating a 60 fields database (1997)
Mozilla/4. and Browser Info.txt (1997)