Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: "FINDING" a value in a persistant file of nested blocks..
Pages: [1] Print
Author Topic: "FINDING" a value in a persistant file of nested blocks..  (Read 283 times)
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
"FINDING" a value in a persistant file of nested blocks..
« on: January 22, 2007, 08:44:17 PM »

I'm trying to mimic the approach to a database file demo'd in chapter 5,  Rebol, The Official Guide (authors now seemingly 'out of business').

I am able to make the "FIND" & "SELECT" functions perform as expected even though the values I have preceded my nested blocks with are 'quoted' (I see no way to programmatically apply them 'unquoted' as theirs are (they were applied by an editor).

I'm wanting to be assured that "FIND" & "SELECT" will not find or select equivalent values from 'inside' the nested blocks....limiting their search always instead to the string values that are 'outside' any particular nested block.....this is how I 'think' they are supposed to work. One record from the file is shown below:


"5342" ["HORNBECK" "EDNA" " " "B" "S" "4" "MT" "NAS" "" " " " " "trayvals" [" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "] "allergies" ["" "" ""] "utensils" ["" "" ""] "brkbevs" ["8 OZ ORANGE JUICE" "COFFEE" ""]
    "dinbevs" ["COFFEE" "" ""] "supbevs" ["COFFEE" "4 OZ ORANGE JUICE" ""] "brksupps" ["" "" ""] "dinsupps" ["" "" ""] "supsupps" ["" "" ""]
    "brkmenu" ["2 SOFT FRIED EGGS" "1 WHITE TOAST" "" "" "" "" "" ""] "dinmenu" ["CUSTARD WHEN ON MENU" "" "" "" "" "" "" ""] "supmenu" ["" "" "" "" "" "" "" ""] "brkdislks" ["FRENCH TOAST" "TEA" "" "" "" "" "" "" "" "" "" "" "" ""] "dinsupdislks" ["SPAGHETTI/MEATBALLS" "TEA" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""]
    "thertechs" ["" "" "" "" "" ""] "nourmets" [[" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""] [" " "  " "    " "" ""]] 22-Jan-2007/20:51:22-5:00
]
Logged
henrikmk
Jr. Member
**
Offline Offline

Posts: 50


View Profile
Re: "FINDING" a value in a persistant file of nested blocks..
« Reply #1 on: January 24, 2007, 05:19:49 AM »

Quote
I'm wanting to be assured that "FIND" & "SELECT" will not find or select equivalent values from 'inside' the nested blocks....limiting their search always instead to the string values that are 'outside' any particular nested block.....this is how I 'think' they are supposed to work.

Both FIND and SELECT do this automatically, since they search on input type and a block at the first level is as much an element as an integer or a string:

Quote

>> find [a [a] b [b]] 'a
== [a [a] b [b]]
>> find [a [a] b [b]] 'b
== [b [b]]

>> select [a [a] b [b]] 'a
== [a]
>> select [a [a] b [b]] 'b
== [b]



No need to worry. :-)
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: "FINDING" a value in a persistant file of nested blocks..
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 09:22:42 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2311 Posts in 595 Topics by 4144 Members
Latest Member: FinoDiato

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc