r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Ladislav
27-Jul-2006
[5110]
suggested reading : http://www.fm.tul.cz/~ladislav/rebol/contexts.html
;-)
Graham
29-Jul-2006
[5111]
Anyone have some information on writing to usb ports ?
Louis
29-Jul-2006
[5112x2]
;To make the following work with a USB printer, do the following:

; 1. share the printer, noting the name given to the shared printer.

; 2. from the command line type: net use lpt1 \\laturk-ws-2\EPSONSty 
/persistent:yes

; 3. put said command line in autoexec.nt so you don't have to type 
it each time.

printer: func [
    "Sends text to printer on //prn."
    [catch]
    Text [string!]    "The text to be printed."
    /Page    "Append Carriage Return (CR) and Page Feed."
    ][
    throw-on-error [
        secure [
            %//prn [allow write]
        ]
        write %//prn Text
        if Page [write/binary %//prn "^(0D)^(page)"]
        Text
   ]
]
Graham, I don't know if that is what you had in mind or not.   I 
think I got the printer function from Andrew Martin.
Graham
29-Jul-2006
[5114x2]
and the instructions above it are from me :)
I was hoping that a direct way of writing to specified usb port migh 
now be avable.
Louis
30-Jul-2006
[5116x3]
:>)
You have taught me most of what I know.
If you would have taught me a direct way of writing to a USB port, 
then I would have been able to help you.  LOL.
Graham
30-Jul-2006
[5119]
Ok, next time I have to try harder.
eFishAnt
5-Aug-2006
[5120x2]
Louis, that is a cool example
...or should I say Graham.
Graham
8-Aug-2006
[5122]
If I have a table of say 4 x 3 and another table of say 3 x 10 .. 
is there a way to merge them so I end up with a table of 7 x 10 where 
the missing cells are either empty or none?
Anton
10-Aug-2006
[5123x3]
By table, do you mean a block of blocks (a 2-dimensional array) ?
Given
	table-A: [[1 2 3 4][5 6 7 8]]
	table-B: [[a b c][d e f][g h i]]
then
	MERGE-TABLES table-A table-B
== [
        [1 2 3 4 a b c]
        [5 6 7 8 d e f]
        [none none none none g h i]
    ]
Is that the desired output ?
An approach I might use: pre-scan tables for row lengths, use ARRAY 
with the total row-length to create result-table , then poke the 
values of each table into the result-table.
Or something like:
	result-table: copy/deep table-A
	; <- scan for longest row

 ; <-- now extend result-table with values from table-B, creating/initializing 
 any missing/short rows first
Graham
10-Aug-2006
[5126x2]
Yes, like a sql join.
I was trying to print a table from two different sources, and trying 
to wrap the data inside the cells at the same time.  But I got it 
worked out now.  But was thinking that some type of sql join on tables 
would be good.
Anton
10-Aug-2006
[5128]
Yes, I just realised your question was two days before. :)
Rebolek
11-Aug-2006
[5129]
Is there some easy conversion of numbers to binary? And I mean numbers 
bigger than 255...
Pekr
11-Aug-2006
[5130]
someone did binary tools,no? Wasn't it Geomol?
Rebolek
11-Aug-2006
[5131]
maybe. but I can't find anything on rebol.org
Pekr
11-Aug-2006
[5132x2]
search altme, it was here ...
Binary tools group
Rebolek
11-Aug-2006
[5134]
thanks, I've found this http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?color=yes&script=base-convert.r
from Sunanda, I'll try it.
Ladislav
11-Aug-2006
[5135]
this is a way how to convert something to binary too: http://www.compkarori.com/vanilla/display/peek_and_poke.r
Pekr
11-Aug-2006
[5136x3]
will there be extended support for such binary conversions in R3?
in current Core, I find it difficult to work with what is available 
in terms of rebol .... I mean - for quick console hack sessions ....
but I am also not good in such topic, so it is maybe me, although 
I think that more ppl reqeusted such functionality in kernel ...
Rebolek
11-Aug-2006
[5139]
I'm 100% sure, there'll be such support in R3...in the long term... 
;)
Pekr
11-Aug-2006
[5140x2]
:-)
maybe with plug-in mechanism, you can write external component to 
handle it, so good old poor pekr can include it and use it :-)
Rebolek
11-Aug-2006
[5142]
hehe :)
Sunanda
11-Aug-2006
[5143]
the pwerpack idea was a good one: one central point for crucial mezzanines 
and their documentation, perhaps as easily included as 
  do %powerpack.r 
  powerpack/install 'all
in user.r
Pekr
11-Aug-2006
[5144x2]
c:\> cd rebol
c:\>rebol\
c:\>rebol\dir
rebol.exe
powerpack.r
c:\>rebol\rebol.exe %powerpack.r
c:\>rebol\dir
rebol.exe
powerpack.r
rebol3.0.exe
it works :-)
Henrik
14-Aug-2006
[5146]
is there a complete list of all the error codes anywhere? I think 
the error appendix in the Core manual is not adequately describing 
them.
Pekr
14-Aug-2006
[5147]
not sure, never saw something like that ...
Henrik
14-Aug-2006
[5148]
it would make it a lot easier to create error handling, if you are 
running some code and might expect a large number of different errors 
that need to be translated into a different language
Anton
14-Aug-2006
[5149]
Have you probed system/error ?
Henrik
14-Aug-2006
[5150]
yes, but I think it's hardly a useful way to do this. once again 
you have to dig around in the system object to figure something out.
Anton
14-Aug-2006
[5151]
You might be able to put the translated strings directly into the 
error objects before the errors are thrown.
Henrik
14-Aug-2006
[5152x2]
I could if I didn't need to process the error contents. For example, 
I try to connect to an FTP server using an URL with user/pass in 
it. This is normally hidden from view, but if the URL fails, the 
entire user:[pass-:-url] is passed to the error object in clear text.
but I see your point
Anton
14-Aug-2006
[5154]
I see, so you would like to show error messages to the user, but 
not reveal the clear text authentication details.
Henrik
14-Aug-2006
[5155x2]
that's one thing. another thing is to make it meaningful to the users. 
it's part of explaining what caused, say a TCP error 550 and help 
the user to act on it, rather than just saying "TCP error 550 blabla". 
The same error may be meaning different things in different contexts.
user interface contexts, that is
Anton
14-Aug-2006
[5157]
- It looks like you can derive the complete list of error codes from 
system/error,  eg: from
	print mold system/error/math
  you can see that  square-root  -1   gives error code 402

- what kind of descriptions do you see as lacking from the Core manual 
section on error codes ?
- I think whole books have been written on errors.
Henrik
14-Aug-2006
[5158]
sorry, I was misreading something and the things I wanted are actually 
in the manual
Anton
14-Aug-2006
[5159]
that's alright. :)