World: r3wp
[Core] Discuss core issues
older newer | first last |
Maxim 25-Nov-2006 [6382x2] | yess I meant the string doc. |
if the string docs emphasizes the deep word, right now its not as obvious what deep implies. | |
Anton 25-Nov-2006 [6384] | Oh ok. |
Maxim 25-Nov-2006 [6385x2] | how can rebol be made to understand UNC filenames... currently, I can't seem to use %//host/ to list shares. :-( |
rebol replaces %// as the root of curent dir... such that %//host/ becomes %/C/host/ for example :-( | |
Anton 25-Nov-2006 [6387] | %/host/ ? |
Maxim 25-Nov-2006 [6388x2] | nope |
%/host/shared/ works... but I want to list those shares? just as listing %/ does for local drives | |
Izkata 25-Nov-2006 [6390] | what happens if you change-dir to %/host/shared/ then change-dir to %.. ? |
Jerry 27-Nov-2006 [6391] | I was processing a Chinese text file using REBOL. The text file was in the Big5 Encoding, which is the de facto encoding we use in Taiwan. A Big5 character needs two bytes, so I used strings whose length is 2 to present Big5 characters. Something weird happened. After a while, I realized that REBOL treated two different characters as they were the same character. Chinese-char1: to-string #{A4 68} ; Big5 Char for "Educated Person" Chinese-char2: to-string #{A4 48} ; Big5 Char for "Human" if Chinese-char1 = Chinese-char2 [ print "This cannot not be happening..." ] How would I fix my REBOL scrip? Thank you. |
sqlab 27-Nov-2006 [6392] | >> strict-equal? probe to-string join #{a4} #{68} probe to-string join #{a4} #{48} ¤h ¤H == false |
Jerry 27-Nov-2006 [6393] | Sqlab, thank you. |
Gabriele 27-Nov-2006 [6394] | = is case insensitive, but that only works with latin1. you should use binary!, not string!, to avoid any problems. |
Jerry 27-Nov-2006 [6395] | Is there any way that I could detect whether the Num Lock or the Caps Lock is on? |
PeterWood 27-Nov-2006 [6396x2] | Not in Core ;-) and I from using Gabriele's keycode onle-line displayer view layout [box feel [engage: func [f a e] [switch a [up [focus f] key [print mold e/key]]]]] It looks as though Rebol doesn't provide an event when Caps Lock is pressed or released. |
I read here : http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-topic-index.r?i=k | |
Cyphre 28-Nov-2006 [6398x3] | It is possible to get keycodes(at least under Windows) even in Rebol/Core: |
system-awake: func [port /local msg][ msg: pick port 1 print [ switch msg/2 reduce [ WM_KEYDOWN ["key down"] WM_KEYUP ["key up"] ] "keycode:" msg/3 "char:" mold to-char msg/3 ] return false ] WM_KEYDOWN: 256 WM_KEYUP: 257 system/ports/system: open [scheme: 'system] system/ports/system/awake: :system-awake set-modes system/ports/system compose/deep [winmsg: [(WM_KEYDOWN) (WM_KEYUP)]] append system/ports/wait-list system/ports/system wait [] | |
as you can see it is possible to catch also KEYUP events in Windows. What a pity system port has a bug under View so it works only when console window is activated. | |
PeterWood 28-Nov-2006 [6401] | Thanks for the enlightenment, Cyphre |
Pekr 28-Nov-2006 [6402] | Cyphre - so why not to fix that system port bug?! That would be nice, as old (pre R3) SDK could have fixed that bug |
Cyphre 28-Nov-2006 [6403] | I have already posted the bug into RAMBO so it depends on Carl's decission now. |
Pekr 28-Nov-2006 [6404] | will system port exist in R3, or it will be done in other way? |
Cyphre 28-Nov-2006 [6405] | You need to ask Carl, but I think system port should be in R3 too. |
Rebolek 28-Nov-2006 [6406] | Can somebody explain to me, how does FIND work in file! ? >> path: %/disk/drawer/ == %/disk/drawer/ >> file: %/disk/drawer/file == %/disk/drawer/file >> find/match file path == %file >> find/match file %/disk == %/drawer/file >> find/match file %/disk/ == %drawer/file >> find/match file %disk/ == none >> find/match file %drawer == none It seems to work only if the searched string stars on begining of file! |
Anton 28-Nov-2006 [6407x2] | That's right, the /MATCH refinement causes exact matching to occur from the position you specify (eg. the start). I was a bit confused by this at first too. What you probably want is the /ANY refinement, which switches on wildcards. So use /ANY instead of /MATCH and you'll be alright. |
There's nothing special about FIND's treatment of FILE! datatype here. It's just another any-string! | |
Rebolek 28-Nov-2006 [6409] | I'm using /MATCH because I want to strip part of path. I'll probably make parse rule for it :/ |
Anton 28-Nov-2006 [6410x2] | Ah.. maybe you want FIND/ANY/TAIL |
or just FIND/TAIL | |
Rebolek 28-Nov-2006 [6412] | Anton great, that's exatly it! |
Maxim 28-Nov-2006 [6413] | Cyphre, where is this documented? |
Gregg 28-Nov-2006 [6414] | You can also use the API to get the current keyboard state, whether or not you trap the key yourself. And, yes, if we ever get system ports working under View, it will be nice; for file drops alone it would be great. |
Jerry 28-Nov-2006 [6415] | About the numLock and capsLock, the problem is solved. In ActionScript, there are "flash.ui.Keyboard.numLock" and "flash.ui.Keyboard.capsLock". I am programming my GUI using ActionScript and my engine using REBOL. And ActionScript and REBOL talk to each other through sockets. |
Gregg 28-Nov-2006 [6416] | Cool. |
Cyphre 28-Nov-2006 [6417] | Maxim: AFAIK the only info about system port I know is here: http://www.rebol.com/docs/changes.html#section-5.10and and also Gregg's script at rebol.org: http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=sys-port-drag-accept.r |
Maxim 28-Nov-2006 [6418x3] | my god... how can such a big feature pass by virtually unused... |
I didnt even know about the system port being something we could program. | |
I was asking and ranting about being able to accept OS events ... and IIRC no one droped this on me ! | |
Geomol 28-Nov-2006 [6421] | Max, you're always ranting maybe!? ;-P (joking) |
Maxim 28-Nov-2006 [6422x2] | hehhee |
I'm the Canadian Pekr ;-) | |
Pekr 28-Nov-2006 [6424] | what? hehe :-) |
Geomol 28-Nov-2006 [6425] | I wan't my x-mas present NOW! .... oh, wrong channel... ;o) |
Maxim 28-Nov-2006 [6426] | hahaha |
Rebolek 28-Nov-2006 [6427] | maxim lol :))) |
ICarii 28-Nov-2006 [6428] | More info on the abilities of system port would be great - till then ill experiment with it to see just what its range is under windows.. |
Graham 28-Nov-2006 [6429] | If Carl is still writing learner docs, perhaps he could finally document the system port. |
Gregg 29-Nov-2006 [6430] | Under Windows, you can trap pretty much any WM IIRC, but you can't do it from a View window, which is the big limitation. Still useful for some things though. |
Graham 29-Nov-2006 [6431] | Eh ? |
older newer | first last |