Re: Sequential Code Logic
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54009
interpreted = N
texte = 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=3DT/Fthen just select the next un-used combination from the database each time= you need one, ordered by the IDcreating the database would have been pretty easy.[loop start=3D1&end=3D99][loop start=3D1&end=3D99][loop start=3D1&end=3D99][loop start=3D1&end=3D99][loop start=3D1&end=3D99] [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 hum=an> mind has no trouble with. Anyway, I figured out a solution, so I though=t I> post it for the archives.> > > [!]----- Calculate the last deed number -----[/!]> [search db=3Dadmin/deed_number.db&neIDdatarq=3Dfind_all&deIDsort=3D1&ma=x=3D1]> [founditems]> [text]theTract=3D[TRACT][/text]> [text]theSub=3D[SUB][/text]> [text]theSquare=3D[SQUARE][/text]> [text]theBlock=3D[BLOCK][/text]> [text]theLot=3D[LOT][/text]> [/founditems]> [/search]> > [!]----- Roll sections over if they've reached their max -----[/!]> [if "[theLot]"=3D"999"]> [then]> [text]newLot=3D1[/text]> [/then]> [else]> [text]newLot=3D[math][theLot]+1[/math][/text]> [text]newBlock=3D[theBlock][/text]> [/else]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99")]> [then]> [text]newBlock=3D1[/text]> [/then]> [else]> [text]newSquare=3D[theSquare][/text]> [/else]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"=3D"D"=)]> [then]> [text]newSquare=3DA[/text]> [/then]> [else]> [text]newSub=3D[theSub][/text]> [/else]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"=3D"D"=) &> ("[theSub]"=3D"99")]> [then]> [text]newSub=3D1[/text]> [text]newTract=3D[math][theTract]+1[/math][/text]> [/then]> [else]> [text]newTract=3D[theTract][/text]> [/else]> [/if]> > [!]----- Increase sections by one where needed -----[/!]> [if ("[theLot]"=3D"999") & ("[theBlock]"!"99")]> [then]> [text]newBlock=3D[math][theBlock]+1[/math][/text]> [/then]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"!"D")]=> [then]> [switch value=3D[theSquare]]> [case value=3DA]> [text]newSquare=3DB[/text]> [/case]> [case value=3DB]> [text]newSquare=3DC[/text]> [/case]> [case value=3DC]> [text]newSquare=3DD[/text]> [/case]> [case value=3DD]> [text]newSquare=3DA[/text]> [/case]> [/switch]> [/then]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"=3D"D"=) &> ("[theSub]"!"99")]> [then]> [text]newSub=3D[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 =3D 1-99> > Field 2 =3D 1-99> > Field 3 =3D A-D> > Field 4 =3D 1-99> > Field 5 =3D 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/
Associated Messages, from the most recent to the oldest:
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=3DT/Fthen just select the next un-used combination from the database each time= you need one, ordered by the IDcreating the database would have been pretty easy.[loop start=3D1&end=3D99][loop start=3D1&end=3D99][loop start=3D1&end=3D99][loop start=3D1&end=3D99][loop start=3D1&end=3D99] [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 hum=an> mind has no trouble with. Anyway, I figured out a solution, so I though=t I> post it for the archives.> > > [!]----- Calculate the last deed number -----[/!]> [search db=3Dadmin/deed_number.db&neIDdatarq=3Dfind_all&deIDsort=3D1&ma=x=3D1]> [founditems]> [text]theTract=3D[TRACT][/text]> [text]theSub=3D[SUB][/text]> [text]theSquare=3D[SQUARE][/text]> [text]theBlock=3D[BLOCK][/text]> [text]theLot=3D[LOT][/text]> [/founditems]> [/search]> > [!]----- Roll sections over if they've reached their max -----[/!]> [if "[theLot]"=3D"999"]> [then]> [text]newLot=3D1[/text]> [/then]> [else]> [text]newLot=3D[math][theLot]+1[/math][/text]> [text]newBlock=3D[theBlock][/text]> [/else]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99")]> [then]> [text]newBlock=3D1[/text]> [/then]> [else]> [text]newSquare=3D[theSquare][/text]> [/else]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"=3D"D"=)]> [then]> [text]newSquare=3DA[/text]> [/then]> [else]> [text]newSub=3D[theSub][/text]> [/else]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"=3D"D"=) &> ("[theSub]"=3D"99")]> [then]> [text]newSub=3D1[/text]> [text]newTract=3D[math][theTract]+1[/math][/text]> [/then]> [else]> [text]newTract=3D[theTract][/text]> [/else]> [/if]> > [!]----- Increase sections by one where needed -----[/!]> [if ("[theLot]"=3D"999") & ("[theBlock]"!"99")]> [then]> [text]newBlock=3D[math][theBlock]+1[/math][/text]> [/then]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"!"D")]=> [then]> [switch value=3D[theSquare]]> [case value=3DA]> [text]newSquare=3DB[/text]> [/case]> [case value=3DB]> [text]newSquare=3DC[/text]> [/case]> [case value=3DC]> [text]newSquare=3DD[/text]> [/case]> [case value=3DD]> [text]newSquare=3DA[/text]> [/case]> [/switch]> [/then]> [/if]> [if ("[theLot]"=3D"999") & ("[theBlock]"=3D"99") & ("[theSquare]"=3D"D"=) &> ("[theSub]"!"99")]> [then]> [text]newSub=3D[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 =3D 1-99> > Field 2 =3D 1-99> > Field 3 =3D A-D> > Field 4 =3D 1-99> > Field 5 =3D 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/
"Andrew Simpson"
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:
Multiple catalog databases and showcart (1997)
[Fwd: Rotating Banners ... (was LinkExchange)] (1997)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
[ModDate] & [ModTime] ? (1997)
LookUp Tag (1997)
Secure server question (1997)
mac hack (1997)
More on the email templates (1997)
different show next (1997)
Configuring E-mail (1997)
[shell] stopped ?? (2003)
Searching a field and returning the highest value (1997)
calculating unique time (1998)
I'm tired of all this! (2000)
New public beta available (1997)
Not carrying Zero (2000)
lineitems are gone (1998)
Problems with [Applescript] (1997)
Ok here is a question? (1997)
WebCatalog 2.0 b 15 mac (1997)