All Questions
249 questions
0
votes
0
answers
32
views
When closing a GUI window, with unview, the focus does not return to the parent
Context: macOS El Capitan, macBook late 2008, red-view-19mar25-6942c7a02
Code directly input in the console:
view layout [ button 100x100 "close" [unview]]
Image 1, the window opens (the ...
0
votes
0
answers
66
views
View VID Can't trigger an action when clicking on an image (tests on Windows added)
Context: macOS El Capitan, macBook late 2008, red-view-19mar25-6942c7a02
Code example:
Red [ about: "on-down with image" ]
; image created with DRAW
pacman: draw 100x100 [
anti-alias ...
2
votes
2
answers
234
views
In Red (R2) how to call a function whose name passed by argument?
I have an arbitrary function with multiple arguments, and I want to call it from command-line like this:
program myfun 7 24 15
I tried to do it this way:
myfun Func: [A B C][...]
ARGS: Probe System/...
0
votes
1
answer
120
views
A particular diff
I have 2 files: list-folder1.txt and list-folder2.txt. These files are derived from the ls -1R command run on linux in their respective folders (similar folders consisting of thousands of files and ...
1
vote
1
answer
177
views
How to integrate Red into Rust?
Does anyone know how to use view from Rust? Do I need to link libRed.dll on Windows? What functions to extern? Must I try to disassemble it? I’m using compiled Red, not interpreted, so libRedRT.lib ...
0
votes
1
answer
182
views
Rebol - How can I append text from a text field to a text list?
I've been exploring the amazing Rebol programming tool. I've run into a problem of trying to append text from a text field into the data of a text-list. My code below adds text to the text-list but ...
0
votes
1
answer
2k
views
How to decompress/deflate zlib data [rfc1951]?
I am looking for decompressing data according to the deflate compression mechanism [rfc1951].
The linux command for this mechanism is:
zlib-flate -uncompress
I try the Red command decompress with ...
0
votes
1
answer
136
views
behavior of call in Red language
On Red console, I tried the following commands:
>> (print 0 call/shell/wait "sleep 5" print 5)
I think 0 would be printed first. After 5 seconds delay, 5 would then be printed.
In ...
1
vote
2
answers
177
views
How to evaluate refinement of a function when calling this function in Red/Rebol
>> f: func [x /a][either a [x + 2] [x + 1]]
== func [x /a][either a [x + 2] [x + 1]]
>> b: /a
== /a
>> f/b 1
*** Script Error: f has no refinement called b
*** Where: f
*** Stack: ...
1
vote
1
answer
124
views
How to link other scripts when compiling main program in Red language
I put some functions' defination in a file named "funcs.red", functions in which would be invoked by main program. Here is the example of "funcs.red":
Red []
myadd: func [x y] [x + ...
0
votes
2
answers
183
views
How to construct a function with a default argument
To make a function with default argument, I tried this:
f: function [a b] [either unset? :b [a + 1] [a + b]]
f 5
f 3 5
then I receive this message *** Script Error: f is missing its b argument.
So, ...
2
votes
1
answer
255
views
How to read key from keyboad in red/rebol
We can get input from console by input or ask, which means to press some keys on keyboard and terminate the input by pressing the key "Enter".
I'd like to know if there is a way to get a key ...
0
votes
2
answers
138
views
Value of local variables in a function seems not be released post function calling in Red/Rebol language
I construct a function named find-all to find all indexes of a given item in a series by "recursive".
The first calling of find-all gives the right output. However from the second calling, ...
1
vote
1
answer
102
views
Use 'parse' in Red language with number block
I imitate the follow code that comes from Helpin'Red
a: "big black cat"
parse a [ to "black" insert "FAT "]
print a
big FAT black cat
with mine:
b: [1 2 3]
parse b [to 2 ...
1
vote
1
answer
177
views
In Red language, how to split a string using split, but also keep the delimiters as nessecary
I want to split a string with the split, meanwhile the string contains the string used as delimiter which should not be treated as delimiter. I tried in this way as shown in the following code:
>&...