Compiling Red console... *** Compilation Error: argument type mismatch on calling: >> *** expected: [number!], found: [pointer! [byte!]] *** in file: %/C/Users/regillig/Documents/MEGA/Code/AoC2017/Day24/modules/view/backends/windows/gui.reds *** in function: exec/gui/adjust-selection *** at line: 1861 *** near: [- p head unit-b case [ size > end/1 [break] size > bgn/1 [end/1: end/1 - 1] true [bgn/1: bgn/1 - 1 end/1: end/1 - 1] ] ]
I create a hash! with 75,000 strings of triples using this code.
n: 1 loop 25000 [ s: rejoin ["user" n] p: rejoin ["pred" n] v: rejoin ["val" n] append db reduce [s p v] n: n + 1 ]
giving me db: make hash! ["user1" "pred1" "val1" "user2" "pred2" "val2"...
I then save this using this code...
saveit: does [ dbsave: to-block db save %db.txt dbsave dbsave: copy  ]
(not sure that's the best way to do that, but it works..open to suggestions!)
When I check the %db.txt, it's saved it as "user1" "pred1"... etc, BUT
It stops saving at "pred19532" ?? It goes only that far every time.
It works fine using the exact same code in Rebol 2
Also when I use save/all %db.txt db
when I view the first bit of the db.txt file..
.. #[hash!["user1" "pred1" "val1" "user2" "pred2"
.. make hash! ["user1" "pred1" "val1" "user2"
mold/allto see what is the string result used by
I find myselft using really often the the
/skip refinement with select. Having a block like the following (or any one treated as record)
myblock: [ key1 value1 value2 value3 key2 value1 value2 value3 key3 value1 value2 value3 key4 value1 value2 value3 key5 value1 value2 value3 ]
Select/skip can't select anything other than the the first column: value1, which is quite limiting.
I see useful removing this limit adding an additional
/offset) integer refinement to
select so instead of the first value, any other could be selected! Without
offset refinement should return the nth value after the key.
>> my_func: function [ MY_FUNC params DESCRIPTION: MY_FUNC is a function! value. ARGUMENTS: params [block!] >> my_func ["one" "two" "three"] one two three >>]][foreach x params [print x]] == func [ ] /local x][foreach x params [print x]] >> ? my_func USAGE:
>> copy/part find/skip myblock [key2 value1] 4 4 == [ key2 value1 value2 value3 ]
>> third find/skip myblock [key2 value1] 4 == value2
mydata: make hash! [ key1 value11 value12 value13 key2 value21 value22 value23 key3 value31 value32 value33 key4 value41 value42 value43 key5 value51 value52 value53 ] myselect: func [data key len pos][ pick find/skip data key len pos ] myselect mydata 'key1 4 1 ;== key1 myselect mydata 'key1 4 3 ;== value12 myselect mydata 'key3 4 2 ;== value31 myselect mydata 'key5 4 4 ;== value53