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

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Gabriele
14-Sep-2007
[913]
i still think it would be much simpler if you just had blocks instead 
of words there :-)
RobertS
14-Sep-2007
[914]
I have this harmless fixation on Oz, the language ;-)
It was a kinda prologue to my coming to Rebol   lol
Gabriele
14-Sep-2007
[915]
i'll need to look at it someday... ;)
PaulB
17-Nov-2007
[916]
Hello, I'm trying to write my first program in REBOL, besides "Hello, 
World!", heh. Anyway, I am trying to take the output of the DOS ipconfig 
command and only grab the IP address for my local NIC out of it. 
I would like to display the IP address only in a window in a large 
font. I have played with the call command in REBOL and have been 
able to use call/output to write the output of the command to a text 
file. My question is what would be the best way of grabbing the IP 
address I need out of this text file? Maybe there is another way 
I should be approaching this too, I'm not sure? Your thoughts and 
suggestions are appreciated. :)
btiffin
17-Nov-2007
[917x2]
Paul;  For one you can skip the intermediate file.  Try
>> res: make string! 80   call/output "ipconfig" res
it'll place the stdout results right in the string res.
Then you have some options.  REBOL has  (to name but two) find and 
parse for this kind of work.
Ashley
17-Nov-2007
[919]
Also take a look at the following functions:

>> system/network/host
>> system/network/host-address
PaulB
17-Nov-2007
[920]
Great, thank you for the quick answers! I'll take a look at this 
new information. :)
btiffin
17-Nov-2007
[921]
Hey!  I was just about to show some parse code and then you come 
along and make it a freebie.  :)  


Paul;  A good lesson right off the bat.  How ever easy REBOL code 
looks.  There is probably something built-in already.  REBOL is definitely 
a blinders off language.  Then again ... I think Ashley has something 
approaching a super power when it comes to quickly seeing alternate 
solutions and big picture implications.  :)
PaulB
17-Nov-2007
[922x3]
Wow, I just tried Ashley's suggestion, bingo the IP I was looking 
for!
I am actually writing this for use in my job. I am a network support/programmer 
and I work for Nuns. I have been connecting to their computers using 
VNC. I always have to try and tell them how to give me the address 
of their machine after I get them to start VNC. They always have 
trouble. So I thought I could write something in REBOL do they could 
just double click and read it clearly on the screen. That is why 
I mentioned the large font.
do=so
btiffin
17-Nov-2007
[925x3]
Just for fun; here is one way of pulling the output from ipconfig.

parse res [to "IPv4 Address" thru  ": " copy ip to newline to end]
And that is just one way of many.
Oh, the variable ip has the ip address as string! after the parse.
Paul;  If you are still reading.  You owe it to yourself to check 
out  http://www.dobeash.comAshley has offered the community some 
real killer development tools; RebGUI and RebDB being but two ... 
seperately both wonderful tookits, together, a very powerful combination.
PaulB
17-Nov-2007
[928]
Cool, I will definitely check that out. I just bookmarked it. Thank 
you!
Graham
17-Nov-2007
[929x3]
http://www.compkarori.com/cgi-local/whatismyip.r
but that's the outside address
which is what I guess you need for logmein, vnc and remote desktop 
etc
PaulB
17-Nov-2007
[932]
ah, good to know. But actually, I don't want the outside IP, because 
the computers I am connecting too are on our LAN on the same campus. 
But I appreciate the information, it may be helpful later.  :)
Graham
17-Nov-2007
[933]
You work in a convent ?  :)
PaulB
17-Nov-2007
[934x2]
Yes.
there is also a college on the same campus that the nuns started 
a long time ago.
Graham
17-Nov-2007
[936]
why not just assign a static ip address?
PaulB
17-Nov-2007
[937]
Well, there are about 200 computers I would have to do that too.
Graham
17-Nov-2007
[938]
oh :(
PaulB
17-Nov-2007
[939x2]
Hehe, thats okay, this was more about me learning REBOL, I just figured 
if I could use it for work, that would be a bonus!
I just wanted simple to start with.
Luis
18-Nov-2007
[941]
Other way: 
read dns://
read join dns:// read dns://
Gabriele
19-Nov-2007
[942x2]
also:
>> probe get-modes tcp:// 'interfaces
[make object! [
        name: "lo"
        addr: 127.0.0.1
        netmask: 255.0.0.0
        broadcast: none
        dest-addr: none
        flags: [loopback]
    ] make object! [
        name: "eth0"
        addr: 192.168.1.4
        netmask: 255.255.255.0
        broadcast: 192.168.1.255
        dest-addr: none
        flags: [broadcast multicast]
    ]]
PaulB
19-Nov-2007
[944]
Very interesting guys, thanks for all the great comments. You are 
showing me a lot of options in REBOL for this kind of stuff, I like 
it.
Joe
26-Nov-2007
[945]
Gabriele, when you have multiple alias per nic and multiple nics, 
how do you go about picking a specific interface for a network connection
Gabriele
28-Nov-2007
[946x3]
afaik, you can't with rebol. the os picks the interface for you.
(and when listening, rebol alwasy binds to all interfaces)
hopefully, we'll find some way to do than in R3
Michael
12-Jan-2008
[949x4]
I have been playing with Cal Dixon's REM editor and Core as a means 
of learning code and trying to identify differences between the 2.5 
Core he wrote it for and the current version. Everything seems to 
work fine except SEARCH, which produces the following error...
** Script Error: if expected then-block
argument of type: block
** Where: seach
** Near: if x: sfind temp whatis
...in reference to his code block:


 search: func [ from whatis /reverse /case /local list x y p temp 
 sfind start end step ] [
         list: buffer/lines
         sfind: to-path join [find] [

            either case ['case]['only] either reverse ['reverse]['only]
            ]
         y: from/y
         set [start end step] reduce any [

            all [ reverse [(y - 1) 1 -1] ] [(y + 1) (length? list) 1]
            ]
         temp: at pick list y (from/x + either reverse [-1][1])
         return if p: catch [

            if x: sfind temp whatis [ throw reduce [ index? x y ] ]
            for y start end step [

               temp: either reverse [ tail pick list y ] [ pick list y ]

               if x: sfind temp whatis [ throw reduce [ index? x y ] ]
               ]
            ] [ to-pair p ]
         ]
What changes need to be made for this to work?

Thanks.
Gabriele
12-Jan-2008
[953]
path!s are no more word-active. x: do sfind ....  should work with 
the latest rebol (2.7).
SteveT
12-Jan-2008
[954]
Perspectives of a newbie! By Steve Thornton (SteveT)


Hi! everyone, as someone brand new to REBOL I've been asked to log 
a journal
describing my experiences using REBOL. 


I think the first thing to get out of the way is to tell you where 
I'm coming

to REBOL from. I've programmed on and off for over twenty years starting 
with

Clipper 5 (dBaseII), Visual Basic (Access), C# (SQL Server), Java(NetBeans 
+

JavaDB). I've worked in a variety contract/freelance work. I earn 
approx half 

my income form 'Thornton Software' and I work for Iris Software Group 
- 

as a training consultant (training accountants :-\ someone has to 
do it!)


I can hear some of you saying 'Ahh! he's an IDE wimp - real men/women 
code

from scratch'. It was strange - every language I've used had an IDE 
and I

was a bit put off having to go find myself an editor. Until something 
better

find's me I'm using the freebie 'CREdit' as recommended by Sunanda. 


The easiest way to edit/test the scripts is to open an explorer window 
at

the side of the CREdit window showing my scripts folder. I can then 
drag a .r 

file onto the CEdit screen and it opens it. To run the script I double-click
it in the explorer window.


The help and documentation available is better than I have previously

experienced. Some of the components I've been wow'ed by so far is 
Henriks

List-View and RebDb from Dobeash. I've looked at RebGUI and for the 
time being 

I would prefer not to use anything on top of VID, I need to learn 
pure VID before
using anything else.


REBOL Cookbook of examples is a useful place to start. Some more 
form oriented 

examples would be cool. Example 014 - 'Open two windows'  and Example 
10 - 'Simple text
form window' are both useful


The Event Handling guide is a good resource for programmers moving 
from Visual
Studio etc..


That's more than enough to be going on with, next time I'll cover 
my experiences 
with VID, FACES and handling Events.

Bye for now.
Steve Thornton
Michael
12-Jan-2008
[955]
Thanks, Gabriele!
Gregg
12-Jan-2008
[956x2]
Good post Steve. I was an "IDE wimp" myself, having from from QuickBASIC, 
PDS, VB, and others. I never thought I would use a language without 
one, but REBOL is just that good. :-)
And when we finally do have higher level tools for building things 
with REBOL, it will be that much better.
Ashley
12-Jan-2008
[958]
Excellent summary Steve. Don't be shy about mentioning things that 
tripped you up or could have been explained / presented better ... 
this is one of the few communities that takes constructive criticism 
very well! ;)
SteveT
12-Jan-2008
[959x4]
Some of my old Java buddies always said that an IDE can get in the 
way of what the programme is supposed to be doing, I'm beggining 
to see what they meant.
Thanks Ashley, I'm amazed at how generous people are here. (Not blowing 
any smoke ther ;-)  But some of the Microsoft communities are very 
elitist. Even though I'm a very experienced VS developer I hate how 
they talk to some of the newbies.
I think my journal (blog) whatever may be useful because I can see 
a lot of Visual Studio developers moving to REBOL - especially when 
3 is fully fledged. Things like VID3 / SVG Graphics etc will be very 
powerful. If I had one comment so far it would be not to rest on 
your laurels as far as the built in widgets are concerned - Everything 
is moveing to a 'RICHER' experience for the user, we can't get away 
with grey-old programmes anymore. The biggest internet buzzword of 
late is RIA  (Rich Internet Applications). With broadband, users 
expect the client side to be richer. REBOLS simplicity and size mean 
it should get miles ahead of the competition. Bill Gates's keynote 
speach recently covered this particular subject.
Perspectives of a newbie! By Steve Thornton (SteveT) 


In your first steps in using REBOL (If your like me) you'll go and 
have a look

at other peoples scripts - luckily the REBOL Viewtop is full of them. 


One thing that stumped me to begin with was that each developer differed

slightly in how they setup their 'Layout' or 'Views' this is because 
there is

a degree of flexibility that covers different situations. You can 
call a view 

and a layout all in one go, or you can make a layout seperately and 
then call 

it when executing the view. While I quickly understood this, I like 
to follow 

'best practice' when creating the initial framework of my application.


It would be a great help if a diagram was available showing where 
to place 

things. For example I went wrong by trying to place view options/effects 

inside the layout structure, When you look at some of the one/two 
line examples
it looks as if you can do that.

Steve