Home   Archive   Permalink



newbie question (more probably coming)

Hello,
    
i am a complete newbie, not only with rebol but with programming generally. But i wanted a simple GUI that helps me convert my DVD collection and i read somewhere that rebol is easy to use. So i have been working with it since yesterday and my GUI actually already does some of the things necessary.
But now the first problem: How do i insert text that includes "" in a field or area?
For example: field "he said "i love it"" won't work because anything after "he said " will be ignored.
    
Thanks in advance for your help.

posted by:   Rob       6-Sep-2010/12:31:05-7:00



{he said "i love it"}

posted by:   Graham       6-Sep-2010/16:53:35-7:00



Hi Rob,
    
Just to complete the possibilities, you can also put single quotes inside double quotes:
    
     "he said 'i love it'"
    
I use curly braces most of the time in REBOL because it's easier to see where they start and end, and curly braces can also be placed inside strings delimited by curly braces:
    
     >> print {hello {quotes}}
     hello {quotes}


posted by:   Nick       6-Sep-2010/22:01:18-7:00



Hi Graham and Nick, thanks to both of yo. Next problem: Probably best to explain first what i'm trying to do: I want my GUI to save two files for me that will be used to encode DVDs. And the text in these files is what i am trying to create with the GUI. I am using several fields and the values of the fields are determined by radio buttons. And then, and here is the next problem, i also want the values selected by the radio buttons to be inserted into the text in an area. For example: I have a field called hor, i select "640" by radio button as value for this field.
Now in an area i have Lanczos4Resize(xxx,yyy) as text and i want the selected value 640 to replace the xxx. How do i do this?

posted by:   Rob       7-Sep-2010/8:49:08-7:00



Is this what you're hoping for?
    
R E B O L []
set-it: does [
     old-val: f/text
     f/text: val show f
     replace/all a/text old-val f/text show a
]
view layout [
across
     radio [val: 640 set-it] text "640" return
     radio [val: 800 set-it] text "800" return
     radio [val: 1024 set-it] text "1024" return
     f: field "xxx" return
     a: area "Lanczos4Resize(xxx,yyy)"
]
    
Maybe would it be better to use a text-list?
    
R E B O L []
res: ["640,480" "800,600" "1024,768"]
view layout [
     text-list data res [a/text: rejoin [{Lanczos4Resize(} value {)}] show a]
     a: area "Lanczos4Resize(xxx,yyy)"
]

posted by:   Nick       7-Sep-2010/10:28:01-7:00