World: r3wp
[Core] Discuss core issues
older newer | first last |
Graham 31-Jan-2005 [403x2] | I'm just looking for the function that decodes the text and returns text, and not an object |
it's likely to be called by decode-url | |
Tomc 31-Jan-2005 [405] | there is a parse-url but it is burried in an objecr and not public/global |
Graham 31-Jan-2005 [406] | yeah, it's in there somewhere |
Tomc 31-Jan-2005 [407] | see ?? decode-url |
Chris 31-Jan-2005 [408] | dehex? (preceded by replace/all text "+" " ") |
Graham 31-Jan-2005 [409] | dehex looks good :) |
Geomol 31-Jan-2005 [410] | Remember & < and > if you have any of those in the text. Shall be replaced by &, < and >. |
Tomc 31-Jan-2005 [411x2] | graham there is a web-to-plain.r at http://www.cs.uoregon.edu/~tomc/ that may work for you |
if you have more char enties than just hex encoding | |
eFishAnt 31-Jan-2005 [413] | there were some note on it in Core release notes IIRC, de-hex and decode-url |
Graham 31-Jan-2005 [414x2] | the microwebserver at http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=webserver.r doesn't decode spaces etc so comes a cropper if the file on disk has a space in it. |
The authors, not mentioned, were "Tyler Booth" "Jeff Kreis" "Bohdan Lechnowsky" | |
eFishAnt 31-Jan-2005 [416] | http://www.rebol.com/docs/changes.htmlnot so much on decode-url, but decode-cgi yes. |
Guest 8-Feb-2005 [417] | how to: create a array of objects ? (like arrays of udt's) |
Sunanda 8-Feb-2005 [418] | blk: copy [] loop 10 [append blk make object! [a: 1]] |
Guest 8-Feb-2005 [419x2] | wow, fast reply. thx sunanda. last question: what syntax I need to access e.g. object array no. 5 or 8 to write values like blk/a: recordset ? |
I have a object with - name, street, and country and a database with 50 records. I would like to store the records into a dynamic object array for later reading... | |
Anton 8-Feb-2005 [421x3] | equivalent to above, but a bit faster in execution (maybe you have a large block): |
blk: make block! 10 loop 10 [insert tail blk make object! [name: copy "<name>"]] ; COPY so all objects don't share the same string | |
objects: copy [] person: context [name: copy "<name>" address: copy "<address>"] get-record-item: func [n field][copy ""] ; <--- you have to make this function look into the database repeat n 50 [append objects make person [name: get-record-item n 'name address: get-record-item n 'address]] | |
Guest 8-Feb-2005 [424x2] | thank you anton. this is the code I was looking for :-)) |
oups, how do I read (after appending) record no. 45 ? person/name (45) ? | |
Anton 8-Feb-2005 [426x3] | objects/45/name |
record-num: 45 objects/:record-num/name ;== "aristotle" | |
That is putting a GET-WORD! in the path. (eg. :record-num ) | |
Guest 8-Feb-2005 [429] | yes, that's it ! running smoth and fast... thank you very much anton. |
Anton 8-Feb-2005 [430] | no problem at all. |
JaimeVargas 14-Feb-2005 [431x5] | ;Isn't this a bug? >> parse #{000102} [#"^@" #"^A" #"^B"] == false >> parse #{000102} ["^@^A^B"] == true |
>> parse #{000102} [#"^@" #"^A" #"^B"] == false >> parse #{000102} ["^@^A^B"] == true | |
I think AltMe is escaping some characters... I hope you guys can copy it and see the actual problem. | |
;The problem doesn't seem to exist for printable chars. >> parse #{313233} [#"1" #"2" #"3"] == true >> parse #{313233} ["123"] == true | |
;Ah. Never mind I forgot about parse/all >> parse/all #{000102} [#"^@" #"^A" #"^B"] == true | |
Ladislav 16-Feb-2005 [436x2] | is there a way how to "simplify" this? (queue is a list!) if any [error? try [tail? queue] tail? queue] [ queue: head queue ; start at a "meaningful" position in the queue ] |
(I would say it is an implementation quirk) | |
Dockimbel 16-Feb-2005 [438] | If queue is a list!, why would [tail? queue] fail ? Can 'queue refer to other kind of value than a list! value ? |
Chris 16-Feb-2005 [439] | all [series? queue tail? queue queue: head queue] |
Ladislav 16-Feb-2005 [440] | >> queue: make list! [1 2] == make list! [1 2] >> remove queue == make list! [2] >> tail? queue ** Script Error: Out of range or past end ** Near: tail? queue |
Chris 16-Feb-2005 [441x4] | all [attempt [tail? queue] queue: head queue] |
But looks like there are greater problems... | |
queue: remove queue -- would fix it too... | |
>> queue: make list! [1 2] == make list! [1 2] >> queue: remove queue == make list! [2] >> all [tail? queue queue: head queue] == none | |
Ladislav 17-Feb-2005 [445] | the last one seems to be the best |
Louis 22-Feb-2005 [446] | Is there a command to give the path to the presently used user.r file? |
Anton 22-Feb-2005 [447] | One of these will probably help you: >> system/options/path == %/D/Anton/Dev/Rebol/View/ >> system/options/home == %/D/Anton/Dev/Rebol/View/ >> system/options/boot == %/D/Anton/Dev/Rebol/View/rebview1257031e.exe |
Louis 22-Feb-2005 [448x3] | Thanks, Anton. Rebol seems to be looking for user.r in system/options/home or system/options/path. It would seem to be more practical for it to look in system/options/boot. |
But I guess each directory might need a different user.r. | |
I trying to get set up to use your dir-utils.r. Thanks for your good work on this. | |
Anton 22-Feb-2005 [451] | Louis, I think: system/options/path is the current directory of the shell environment where rebol was started from. system/options/home is the rebol starting directory, where it looks for user.r etc. In WinXP this value is taken from the registry at HKCU\Software\Rebol\View\HOME, but only for full release versions (like Rebol/View 1.2.1.3.1). I imagine there is a HOME environment var set in *nix. |
DideC 22-Feb-2005 [452] | REBOL_HOME afaik |
older newer | first last |