newbie question (and some frustration)
[1/8] from: greg::brondo::algx::com at: 1-Mar-2004 17:39
The code below fails with the error listed. The /custom refinement expects a
block '[post <string>]'. However, it doesn't like a word that's value is a
string. What gives? Anyone please help! I've wasted a good hour trying to
make this work.
fld_lastname: "brondo"
fld_firstname: "greg"
txt-search: rejoin [txtLastname=" fld_lastname "&txtFirstname=" fld_firstname]
web-data: read/custom http://chiex04.algx.com/phone/phone_search_results.asp
[post txt-search]
print web-data
Any ideas?
[2/8] from: ammon:addept:ws at: 1-Mar-2004 17:52
You need to use REDUCE instead of REJOIN. REDUCE leaves the value a block
while evaluating the expressions within the block whereas REJOIN evaluates
the expressions and turns them into a string.
HTH
~~Ammon ;~>
[3/8] from: ammon:addept:ws at: 1-Mar-2004 18:19
My last post was a little premature...
The problem lies in the fact that a word within a block is just a word.
This code should make it all work...
web-data: read/custom http://chiex04.algx.com/phone/phone_search_results.asp
reduce ['post txt-search]
use REDUCE or COMPOSE to get the value of the word (txt-search in this case)
An example using compose...
web-data: read/custom http://chiex04.algx.com/phone/phone_search_results.asp
compose [post (txt-search)]
HTH
~~Ammon ;~>
[4/8] from: nitsch-lists:netcologne at: 2-Mar-2004 2:34
Am Dienstag, 2. M=E4rz 2004 00:39 schrieben Sie:
> The code below fails with the error listed. The /custom refinement expects
> a block '[post <string>]'. However, it doesn't like a word that's value is
> a string. What gives? Anyone please help! I've wasted a good hour trying
> to make this work.
http://chiex04.algx.com/phone/phone_search_results.asp
reduce['post txt-search]
note the <'> before the post, and the reduce.
the trick here is that rebol does not know which word you want to fetch, and
which to keep. surely you dont want the 'post to be evaluated, it shall stay
a word. while the 'txt-search shall be fetched. rebol is confused here and
instead of guessing it prefers to reclaim.
What it wants is [post "txtLastname=brondo&txtFirstname=greg"],
and that does the reduce. which fetches everything in a block.
And the <'> before post tells reduce not to fetch, but to keep it as word.
More correctly reduce does not fetch, but evaluate. this means fetch for
normal words and "remove the <'>" for ticked words.
Its an important thing to know, because rebol does not manage this behavior
completely consistentely, some functions are smart and reduce themself, some
are not. so when passing a block, check how the function handles the
reduce-thing.
> fld_lastname: "brondo"
> fld_firstname: "greg"
<<quoted lines omitted: 3>>
> print web-data
> Any ideas?
(Btw, somewhere is a <"> missing, do you find it? and the link did not work
for me. Not a big problem, but checking the posting in console first saves a
minute to the testers. ;)
HTH
-Volker
[5/8] from: greg:brondo:algx at: 2-Mar-2004 10:30
Thanks! Reduce worked like a champ. Now I think I'm starting to understand a
'little' better ;-).
BTW, is there anywhere to find info about all the available system objects and
what not in Rebol? I 've notice in a some or Carl's scripts he accesses
object that I've never seen mentioned in the documentation.
Thanks again!
Greg B.
On Monday 01 March 2004 07:19 pm, Ammon Johnson wrote:
[6/8] from: ammon:addept:ws at: 2-Mar-2004 9:43
From the Link console...
Found these words:
blank-face object! [type offset size span pane text color image
effec...
ctx-install-fileset object! [spec-obj]
ctx-link object! [ctx-link-exec init-link-root link-sync
server-tag...
ctx-server-prefs object! [select-server server-prefs servers
server-names l...
ctx-text object! [view* hilight-text hilight-all unlight-text
hilig...
error-object object! [code type id arg1 arg2 arg3 near where]
face object! [type offset size span pane text color image
effec...
header-rules object! [name full-line template head-list w spot
field-ch...
mail-list-rules object! [addr-list addr opt-cmt mailbox maillist
parse-mai...
net-utils object! [confirm net-log net-install URL-Parser export
con...
netscan object! [email smtp pop3 proxy proxy-port proxy-type
def-b...
REBOL object! [version build product components words license
op...
req-file object! [dp p1 ld dn s1 lf fn s2 p2 ef p3 so ob ff fp
fcnt...
req-funcs object! [req-color req-pass req-text req-list req-date]
rmp-header object! [V T S P CC AC U PK SK ST N C IP Content]
rmp-header-rules object! [full-line head-list field-chars cont-line
head-li...
rmp-http-response object! [Transfer-Encoding Content-Length]
Root-Protocol object! [port-flags open-check close-check write-check
ini...
server-prefs object! [name host path root keys]
sound object! [type rate channels bits volume data]
ssdp object! [host port-id user pass type bypass]
svv object! [verbose warn word-limits vid-feel icon-image
radi...
svvc object! [font body button bevel title field
field-select f...
svvf object! [sensor hot hot-area radio led check button
icon s...
System object! [version build product components words license
op...
user-prefs object! [name pass express server script proxy-user
proxy-...
xml-language object! [verbose joinset diffset error space char
letter d...
HTH
~~Ammon ;~>
[7/8] from: ammon:addept:ws at: 2-Mar-2004 9:46
I really should start reading my messages before I post them. ;~> I don't
know how I missed the first line from my console session...
>> ? Object!
HTH
~~Ammon ;~>
[8/8] from: maximo:meteorstudios at: 2-Mar-2004 11:47
> -----Original Message-----
> From: Greg Brondo [mailto:[greg--brondo--algx--com]]
<<quoted lines omitted: 3>>
> he accesses
> object that I've never seen mentioned in the documentation.
That is because they exist only within specific contexts. an example is the whole vid
layout engine, which is subtly closed from the outside, but if you start peeking into
its code, you will see a massive amount of things which do not seem to exist... that
is because they are wrapped in contexts (objects).
The definite rebol sniffer is Romano's anaMonitor!
its the deFacto debugging/analysis tool many have come to rely on :-)
get it on the rebol.org repository at:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=anamonitor.r
-MAx
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted