Images, snippets, snapshots, math

View Gabriele Lami's profile on LinkedIn

lunedì 6 luglio 2009

Rebol Search File

Another little Rebol program:

rebTest.r

REBOL [Title: "Ricerca"]
mainWin: layout [
banner green "Ricerca Parola" box brick 580x2
text "Parola da cercare"
infi1: field infi2: field ""
text "nome file"
selFile: text-list data read %. [
infi2/data: value
infi2/text: value
show infi2
]

button "Ricerca" [
fil1: to-file infi2/data
text: read fil1
outOne: copy ""
while [ text: find text infi1/data ] [
formattedStuff: reduce [ " ( " index? text " ) " copy/part text 10 ]
append outOne "^/ ( indice ) riga: "
append outOne form formattedStuff
text: next text
]
tuno/text: form outOne show tuno
]
at 260x70
tuno: area 340x300 across
text "Risultato"
]
windowHelp: layout [
backcolor linen
h2 "Help Window"
text 300 { Inserisci la parola da ricercare e il nome del file...
}
button "Chiudimi" [ unview/only windowHelp ]
]

windowHelp/offset: mainWin/offset + (mainWin/size * 1x0) + 10x0
view/new mainWin
view/new windowHelp
do-events

2 commenti:

Reboltutorial ha detto...

Can't make it work (I use latest version of rebol).

koteth ha detto...

could you explain better the problem?
i've rerun the file rebTest.r and with my REBOL/view 2.7.6 it works