Ciao Giuseppe,
GC> I want to get news from some sites.
This is a good start; nice and abstract.
GC> In the first phase I want to fill an array which will contain
GC> objects with data like: news_site news_tittle getnews_method
GC> getnewsinfo1_method
Let's forget about arrays and objects for a moment. How is the data
structured, what are the relationships, how is it loaded? e.g.
It sounds like you have two lists: a list of ~10'000 news sites, and
a list of ~10 methods that are used to read those sites. Is that
correct? And you need to know which method to use for each site.
types
method-1
method-2
...
news-sites ; ~10'000
title ; is this dynamic or static?
url ; the target data source
type ; tells us how to read it, ~10 types (origins)
news-site
read ; method to read data from the site
data: [
site-1 http://blah-1 method-1
site-2 http://blah-2 method-2
]
GC> Then I want to view the news inside a list using VID (RebGUI ?)
GC> and read the news clicking on a line. On each click the NEWSREAD
GC> method for that kind of site must be executed.
layout [
list [
text 300 [read-site selected-site]
] supply [
; add supply code here...
; face/text pick sites count
]
]
GC> I know I could do this using a "switch" statement and
GC> getnews_method will point to the code associated with that site
GC> value but I want to use a more compact version of the function.
Something like this:
read-site: func [site] [
do get newsarray/:site/type newsarray/:site/url
]
GC> (I want to understand more complicated things)
Don't confuse complexity with power. :) REBOL's power does not come
from complexity.
Ciao!
-- Gregg
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.