Test, please ignore.

2005-01-07 Thread Beckett Richard-qswi266
Well, at least it's not as bad as the out of office auto replies! ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: count of matches

2004-12-23 Thread Beckett Richard-qswi266
> You can also use this bizarre construction to capture just the count: > > $_ = "ABabcde12345BAABabcde1234blahblah5BA"; > $count = () = $_=~ /(AB.*?BA)/g; > print "I matched $count times\n"' > > the () between the two ='s forces the match to list context, and then > THAT is forced t

RE: Killing a Process

2004-11-26 Thread Beckett Richard-qswi266
A completely untested thought that popped into my head when reading the thread... Get all PIDs for Excel instances. Start your instance of Excel. Get all PIDs for Excel instances. This way you should be able to work out which one is yours? Like I said, untested, and just a thought. R.

RE: Going back to earlier perl.

2004-11-22 Thread Beckett Richard-qswi266
> To: Beckett Richard-qswi266 > Cc: [EMAIL PROTECTED] > Subject: Re: Going back to earlier perl. > > > Beckett Richard-qswi266 wrote: > > Guys, > > > > I'm having too many problems with activeperl 5.8.4 build > 810, so I've decided to go back to

STDERR & STDOUT to screen and file.

2004-11-19 Thread Beckett Richard-qswi266
Hi Guys, All I want to do is to have STDOUT and STDERR going to the screen AND to a log file as well. You'd think this would be easy, wouldn't you? Well, unless my widgets have come loose, it isn't. I was tearing my hair out last night, and finally gave up at 2am! I suppose the lateness of the

RE: Is anybody else having problems with the mailing list?

2004-11-17 Thread Beckett Richard-qswi266
No. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Ted Schuerzinger > Sent: 17 November 2004 04:41 > To: Perl Mailing List > Subject: Is anybody else having problems with the mailing list? > > > I haven't received a message for four days. And

UN-redirecting STDOUT.

2004-11-16 Thread Beckett Richard-qswi266
Hi Guys, I've managed to log STDOUT to a file like this... if (defined ($outfile)) { $tee = IO::Tee -> new(">$out", \*STDOUT); select $tee; } However, if I want to stop logging to a file, but carry on getting print outs to the screen, what do I need to do? Thanks. R. _

Going back to earlier perl.

2004-11-15 Thread Beckett Richard-qswi266
Guys, I'm having too many problems with activeperl 5.8.4 build 810, so I've decided to go back to 5.8.1 build 807. As long as I make a note of the modules that I've personalised, is there anything else I need to save before blowing 5.8.4 away? Thanks. R. __

RE: regex in <>

2004-11-05 Thread Beckett Richard-qswi266
use strict; use warnings; my $pat = "abcdijklmnopuvwxyz"; print "\$pat is $pat\n"; $pat =~ /<(.*)>.*<(.*)>/; my ($one, $two) = ($1, $2); print "\$one is $one\n\$two is $two\n"; R. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Jutu Subramanian,

Debugger again.

2004-11-03 Thread Beckett Richard-qswi266
Guys, Most of my scripts involve Tk GUIs, so once I started to use the debugger 'properly', I've discovered that it's next to useless when Tk is involved. Is there a debugger that would be useful for debugging a Tk script? Thanks. R. ___ Perl-Win32-U

RE: Using the Graphical Debugger that comes with the PDK.

2004-11-03 Thread Beckett Richard-qswi266
> Like maybe use quick eval (^E) to eval "@ARGV". Aaahhh! OK, you can slap me now ;-) I was using QuickEval on @ARGV, rather than on "@ARGV" D'oh! Thanks, R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.Acti

RE: Using the Graphical Debugger that comes with the PDK.

2004-11-03 Thread Beckett Richard-qswi266
So if I'm debugging something like this: my @list = @ARGV; unless I add these lines to my script: for (@list) { my $var = $_; } I'm not going to be able to look at the contents of either array in the debugger? R. ___ Perl-Win32-Users mailing list [

Using the Graphical Debugger that comes with the PDK.

2004-11-03 Thread Beckett Richard-qswi266
Guys, I've just started playing with the debugger that came with the perl dev kit, and I'm wondering if it's possible to view the contents of an array? I have @ARVG, but if I evaluate it, I get 4, which I should have expected, I suppose, but I would also like to see what the array elements are.

RE: How to obtain filesize?

2004-11-03 Thread Beckett Richard-qswi266
All you need to get the file size is -s. I.e. $file_size = -s $file Save the following script as size.pl, and run like this: perl size.pl size.pl use strict; use warnings; my $file = $ARGV[0]; my $file_size = -s $file; print "$file is $file_size bytes\n"; -Original Message- From: [EMA

RE: How much trouble do you go to?

2004-10-21 Thread Beckett Richard-qswi266
> $id = "*" unless defined $id and $id =~ /\d{1,3}/; > > I usually don't do it that way, it's easier to catch it when you init > $id in the first place. Good point $Bill. So, what I should do is: my $id = $botid || "*"; rather than: my $id = $botid; which could be undefined (depending on how

How much trouble do you go to?

2004-10-21 Thread Beckett Richard-qswi266
Guys, I'm checking a variable with a pattern match... $id = "*" unless ($id =~ /\d{1,3}/); Now, this works everytime, and gives me the result I want, even if $id is undefined. However, if $id IS undefined, I also get this message: Use of uninitialized value in pattern match (m//) at... So, in

RE: RE : How to get remote logical drive letters

2004-10-20 Thread Beckett Richard-qswi266
> David Liouville wrote: > > And how to get physical informations about disks ? Physical information? What, like width, height, weight, colour? ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/

RE: How do I stop a sub?

2004-10-19 Thread Beckett Richard-qswi266
blem, this wouldn't work, as there is no loop in the start sub, and I don't want to have to put loads of 'return if $cancel;' lines all through it (if I can help it!). R. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of

How do I stop a sub?

2004-10-19 Thread Beckett Richard-qswi266
Guys, Try the script below. What it should do is this... Start it up, and it will wait for you to press a button. Press 'Exit' and it exits. Press 'Start' and it starts counting up to 100. Once stared, there is a cancel button. If you press 'Cancel' it should stop the counting, and return to the

RE: GUI front End

2004-10-19 Thread Beckett Richard-qswi266
Lee, Try typing widget at the command prompt. This will show you around Tk. R. > All, > Now, I know I can build a front end in Visual Basic, but I > would like to take the opportunity to do something new. Can I > build a GUI using perl? If so, can someone point me to some examples. __

Excel macro to perl conversion.

2004-10-14 Thread Beckett Richard-qswi266
Guys, Can anyone help me to do what this excel macro does, but from perl, please? I have tried this, but it doesn't seem to do anything: my $range = "A1:C49"; my $sheet = $workbook -> Worksheets("Graph"); $sheet -> Activate(); my $chart = $sheet -> ChartObjects("Chart 1"); $chart -> Activate();

RE: Help with array of arrays!

2004-10-13 Thread Beckett Richard-qswi266
Thanks to all those who helped, so far! :-) foreach ( @array ) { print join ( ", ", @{$_} ), "\n"; } This is the nice easy print statement I was looking for, but I don't quite understand it. I get the print, and the join, but what is @{$_} all about? Going back to the array: 1/1/2004 0 34.5

Help with array of arrays!

2004-10-13 Thread Beckett Richard-qswi266
Guys, This script: use strict; use warnings; my @array; for (0..3) { push @array, ["$_:", 1, 2, 3]; } for (0..$#array) { my $row = $_; for (0..3) { my $col = $_; print "$array[$row][$col], " unless ($col == 3); print "$array[$

Incrementing the date?

2004-09-13 Thread Beckett Richard-qswi266
Guys, I have another conundrum... I have a directory with a series of files, named like this: 251_20040525_051500.log Where the 251 is a device number, and the 20040525_051500 is a date and time string, which means: 25th May 2004 05:15.00 I can easily extract the date, and hour (which is all

RE: Is it there?

2004-09-13 Thread Beckett Richard-qswi266
> sub _Typelib { > my ($clsid,$title,$version,$langid,$filename) = @_; > # Filenames might have a resource index appended to it. > $filename = $1 if $filename =~ /^(.*\.(?:dll|exe))(\\\d+)$/i; > # Ignore if it looks like a file but doesn't exist. > # We don't verify existance of

RE: Help with exec command

2004-09-03 Thread Beckett Richard-qswi266
> As you want the quotes passed to the "shell" try... > > $arg1 = "\"c:/my_scripts/file.txt\""; > or > $arg1= '"c:/my_scripts/file.txt"'; (single quoted > string with "'s > inside) I've tried every combination I can think of of \", and '", but I couldn't get it to work. Have

Help with exec command

2004-09-03 Thread Beckett Richard-qswi266
Guys, This seems really simple, but I can't get it to work! This works as intended... my $arg1 = "c:/my_scripts/file.txt"; my $arg2 = "c:/my_scripts/another.txt"; my $program = "c:/my_scripts/cheese.pl"; my @args = ($arg1, $arg2); exec "$program @args"; HOWEVER, I cannot for the life of me get

RE: Recurse directories.

2004-09-03 Thread Beckett Richard-qswi266
That's the ticket! Thanks. R. > From: Rhesa Rozendaal > attrib -R \your\directory /S /D ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recurse directories.

2004-09-03 Thread Beckett Richard-qswi266
Guys, I know I shouln't ask like this, but I don't want to re-invent the wheel, and I bet that most seasoned hackers out there already have a snippet that'll do this... What I want is to supply a directory, and have a script go through every file and sub-dir recursively, turning the read-only p

RE: This can't be true!? (Tk messageBox and XP) Not XP, but perl!

2004-08-26 Thread Beckett Richard-qswi266
> >if ($var =~ /no/i) > > I think that the original sender of the message (and most > everyone else) > knows the solution. His point is that this kind of change > should never > happen. I'm glad I don't use Tk. Thanks for that vote of confidence! :-) It turns out that it's not a W2K -> XP is

RE: Time::HiRes problems

2004-06-16 Thread Beckett Richard-qswi266
> The problem is that for Perl 5.8 Time::HiRes is a core > module, installed > in Perl\lib. Installing another version via PPM into Perl\site\lib > doesn't do anything for you unless you change the order of directories > in @INC. Or you have to move the module into the lib tree manually > (don't f

RE: Time::HiRes problems

2004-06-16 Thread Beckett Richard-qswi266
Hi Jan, can you help with this confusion, please? c:\>ppm query Time-HiRes Querying target 1 (ActivePerl 5.8.1.807) 1. Time-HiRes [1.59] High resolution alarm, sleep, gettimeofday, interval timers c:\>perl -MTime::HiRes -e"print $Time::HiRes::VERSION" 1.52 c:\>perl -MTime::HiRes -e"print Time::

RE: Time::HiRes problems

2004-06-16 Thread Beckett Richard-qswi266
Ooh, I wrote something similar. Is this any use to you? use Time::HiRes qw( usleep gettimeofday tv_interval ); ... $start = [gettimeofday()]; if ($ping -> ping ($host, $timeout)) {$success = 1} $end = [gettimeofday()]; $interval = (tv_interval ($start, $end) * 1000); # $interval in ms. R. -O

RE: Tk Popup centering and minsize.

2004-06-02 Thread Beckett Richard-qswi266
> Then you will have to hack the Wm.pm module. You need to add > three lines. > i.e. The middle three as shown below. > > I will supply Nick with a proper patch for the next version. > > > my ($mw,$mh) = ($w->reqwidth,$w->reqheight); > my ($minwidth,$minheight) = $w->minsize; #JD# > $mw =

Tk Popup centering and minsize.

2004-06-01 Thread Beckett Richard-qswi266
Hi Guys, Does anyone know if there is a way to get popup to work properly, after you've issued a minsize command? In the example below, if you comment out the line "$popup2 -> minsize (qw(162 190));" in the popup2 sub, then the second popup appears in the centre of the main window. With that l

RE: Perl Tk

2004-05-27 Thread Beckett Richard-qswi266
It's not clear what you really want, but what about this...? sub print_rec() { open (SAVE, ">>c:/save/data.txt"); @key = keys %info; foreach $_ (@key) { print "$_:$info{$_}\n"; print SAVE "$_:$info{$_}\n"; } close SAVE; } R. -Original Message- From

RE: Editor - finding lines

2004-05-27 Thread Beckett Richard-qswi266
> I would think just a normal search feature would be good enough. > Find the first one and then hit next for the next one etc. That, IMO is the best feature of Crimson Editor... you can highlight something with the mouse, hit F3 and it takes you to the next instance of it, hit F3 and it takes y

Reading a file then going back a line.

2004-05-14 Thread Beckett Richard-qswi266
Guys, I have a script that reads a file line by line, looking for a start tag. When it finds one, it jumps to a processing routing that continues through the file, line by line until it reaches an end tag. Then it carries on looking for a start tag. I have just found a scenario where a start t

RE: searching a file for keywords

2004-04-19 Thread Beckett Richard-qswi266
> I thought this would do the trick: > > if($wholefile =~ /^\s*$keyword\s*$/) This could be a \n issue. Do you chomp $wholefile before the match? If you don't want to chomp it, then try: if ($wholefile =~ /^\s&$keyword\s*\n$/) > This works, but is not as specific as I would like: > >

RE: Regular expression to test for numeric values

2004-04-02 Thread Beckett Richard-qswi266
> So I get: > > /^-?(?:\d+\.?\d*|\.\d+)$/ I'm being thrown by the ?: What's that all about? R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Array from a string.

2004-04-01 Thread Beckett Richard-qswi266
> Nothing. Since Text::ParseWords is one of the core Perl modules, it is > not listed by PPM. Only core modules that have been upgraded > will appear in a query listing. Ah! > I've never quite understood the rationale behind that. To confuse the slightly less new newbie? Must keep 'em on t

RE: Brain fade day!

2004-03-19 Thread Beckett Richard-qswi266
> Can someone tell me what would be wrong with: > >$geom =~ s/^\d+x\d+//; Nothing! :-) It's a lot neater, too. Told you I was having a brain fade day! ;-) R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.Active

RE: Brain fade day!

2004-03-19 Thread Beckett Richard-qswi266
Thanks Guys, I've got some quite interesting methods from that! The one that I knew, but just couldn't focus on for some reason was: $geom =~ s/.*(\+-?\d+\+-?\d+)$/$1/; (Forgot that you could get 367x313+-70+-18). I'll slap myself again! ;-) R. > Guys, > > I must have brain fade, 'cause I ca

Brain fade day!

2004-03-19 Thread Beckett Richard-qswi266
Guys, I must have brain fade, 'cause I can't work out how to do this... I get a geometry string with "my $geom = $mw -> geometry;" which gives $geom = "104x28+619+498". I want $geom to be just the "+619+498" part of above. It seems silly to do it like this, beacuse the if will always be true.

Win32::FileOp SaveAsDialog position.

2004-03-17 Thread Beckett Richard-qswi266
Hello world! Does anyone know how to position the Win32::FileOp SaveAsDialog window? At the moment it always seems to come up in the top left corner of the screen. Is it something to do with the -handle option, and am I doing that right if the main window is called $mw? I am invoking it like t

RE: Win32::GUI Question

2004-03-12 Thread Beckett Richard-qswi266
According to the docs on CPAN, there's a -multiple option, but I can't get it to work. Let us know if you have any joy. R. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Dirk Bremer \(NISC\) > Sent: 12 March 2004 14:55 > To: [EMAIL PROTECTED] > Sub

Tk getSaveFile

2004-03-12 Thread Beckett Richard-qswi266
Guys, When I use getSavefile, if the user selects an existing file name, then a dialog box pops up saying it exists, and do they want to overwrite it. However, the way that my script works is that if you choose to write to an existing file, it appends to that file, rather than overwriting it.

Tk remove widget after a few moments.

2004-03-12 Thread Beckett Richard-qswi266
Guys, I've done a GUI that parses text files into csv files. When it's finished I place a widget called $done on the gui. If you press the Go button again, it destroys $done, then starts processing, and places $done on the gui again when it's finished. The problem is, I want $done to disappear

Win32:OLE Excel last row question.

2004-02-13 Thread Beckett Richard-qswi266
Guys, This line successfully gives me the last used row in a populated spreadsheet: my $LastRow = $sheet->UsedRange->Find({What=>"*", SearchDirection=>xlPrevious, SearchOrder=>xlByRows})->{Row}; However, if the spreadsheet in empty, I get the following error: Can't use an undefined value as a H

RE: Unusual Tk question.

2004-02-06 Thread Beckett Richard-qswi266
--Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Beckett Richard-qswi266 > Sent: 06 February 2004 12:38 > To: [EMAIL PROTECTED] > Subject: Unusual Tk question. > > > Guys, > > I find myself in a slightly tricky, and possib

Unusual Tk question.

2004-02-06 Thread Beckett Richard-qswi266
Guys, I find myself in a slightly tricky, and possibly unusual situation. I have been handed a GUI, written in Delhpi. I have a button that collects some parameters, then fires off my perl script. Now, I want to use Tk and open up a window with a Text widget in it that reports the progress of th

RTFF (was Press any key to exit)

2004-01-14 Thread Beckett Richard-qswi266
> Interesting how people tend to start and end searches these days with > Google. Next time you may want to check the FAQ. The answer > to this question is in PerlFaq8. Following on from this RTFF, I have a problem with perldoc on my W98 machine at home. The lines of text | always come

Delphi problem (It _is_ related).

2004-01-13 Thread Beckett Richard-qswi266
Guys, I've just been handed a GUI based program that's been written in Delphi 7 (whatever that is). I think that Delphi is a GUI builder that's based on Pascal. Does anyone know if there's a Perl vesrion, or can I convert what's already been done into perl somehow? Or is it time to learn Pascal?

Copying directories.

2004-01-13 Thread Beckett Richard-qswi266
Guys, I thought this woule be a lot easier than it seems... All I want to do is to copy a directory, and everything it contains (whatever this may be) to a new directory. I (finally) managed it with a system command: if (system "xcopy /E/I/C \"$default_path\" \"$new_path\"") {print "Copy failed

Capturing X.

2003-12-18 Thread Beckett Richard-qswi266
Guys, Does anyone know how to catch the user pressing the X in the corner of the window, like I can catch the Control-C? $SIG{"INT"} = \&control_c; Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveSt

RE: SOLUTION - Problem with Win32::Console and END block.

2003-12-18 Thread Beckett Richard-qswi266
o:[EMAIL PROTECTED] Behalf Of > Beckett Richard-qswi266 > Sent: 18 December 2003 12:05 > To: [EMAIL PROTECTED] > Subject: SOLUTION - Problem with Win32::Console and END block. > > > I just thought I'd share the suggested solution... > > With the problem bel

SOLUTION - Problem with Win32::Console and END block.

2003-12-18 Thread Beckett Richard-qswi266
exactly sure, but it does work. If anyone can explain it better, please do, as I'd like to understand it fully. R. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Beckett Richard-qswi266 > Sent: 16 December 2003 17:32 > To: [EMAI

Problem with Win32::Console and END block.

2003-12-16 Thread Beckett Richard-qswi266
Does anyone know a way around this one. I want to set my dos window up with 80 cols and 100 lines, but when I do I break my END block. use strict; use warnings; $| =1; # use Win32::Console; # my $BUFFER = new Win32::Console(STD_OUTPUT_HANDLE); # $BUFFER->Size(80,100); for (1..5) {print "."; sleep

RE: $SIG{'INT'}

2003-12-16 Thread Beckett Richard-qswi266
I just upgraded to V5.8.1 build 807, and All Is Well (TM). R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: regular expression replacement

2003-11-28 Thread Beckett Richard-qswi266
Hi, I would like to know how can I replace the value c:\qqq\www\ to c:/qqq/www/. I tried several ways, but didn't manage to. Thanks, Eran s!\\!/!g ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveStat

regex and filename

2003-11-27 Thread Beckett Richard-qswi266
Guys, Someone must have already done this, but I know I can't! I have an input file name, and using: use File::Basename; fileparse_set_fstype("MSWin32"); my $file = fileparse ("$ARGV[0]"); my $path = dirname ("$ARGV[0]"); I am splitting the input file name into $file and $path. I can handle t

Pacify user.

2003-11-25 Thread Beckett Richard-qswi266
Guys, I've just completed a fantastic script that parses log files. ;-) I sent it it to a user to test, and he thought that his PC had hung, whereas in fact he'd just given it a huge file to parse. So, he ended it, despite the fact that I printed "Parsing log232.txt, please wait. This may take so

command prompt problems.

2003-10-30 Thread Beckett Richard-qswi266
Guys, I've installed perl at home on my W98 system. There are many reasons why I want to stick with w98, so changing OS is not an option. The problem is, that I use the command prompt a lot when writing/debugging scripts, but the w98 prompt is really crap. It won't let you specify the size of th

RE: reading/writing to a ascii file

2003-10-28 Thread Beckett Richard-qswi266
> Ok guys here is the pickle I'm in now =-) I need to read from > a ASCII file and only modify the lines that match a variable. > I do not want to read the entire file into memory and write > the entire file out each time I need to make a change. > Here is what I am doing that reads the entire f

LabEntry

2003-10-20 Thread Beckett Richard-qswi266
Hi Guys, I've got some LabEntries, but I can't figure how to insert a value into them! I don't understand how -textvariable is supposed to be used, so I was trying to use: $labentry -> insert ("end", $seasons{key}{$points}); What am I doing wrong? Thanks. R. _

Tk forgetting grid labels.

2003-10-16 Thread Beckett Richard-qswi266
Guys, I have a Tk GUI, which contains a notebook. On a particular page, I use grid to place some rows of labels. The user can initiate a command that results in there being less rows of labels on this page, however when they do, the old labels are still there. How do I get rid of them? I've tr

Hash matching question.

2003-10-15 Thread Beckett Richard-qswi266
Guys, I'm scanning a text file, which has lines like this: FirstPlace = 10 SecondPlace = 6 ThirdPlace = 4 FourthPlace = 3 FifthPlace = 2 SixthPlace = 1 SeventhPlace = 0 EightPlace = 0 they are lines 35..42. If the points go 10,6,4,3,2,1, I want to set a var to 0, and if they go 10,8,6,5,4,3,

TK positioning viewable area of scrolled rotext

2003-10-08 Thread Beckett Richard-qswi266
Guys, I am using a scrolled rotext widget with 2 lines as a status bar, so that the user can scroll backwards over the messages. How do I make the widget display the bottem of the scrolled area, rather than the top? Thanks. R. ___ Perl-Win32-Users mai

RE: Chomp to trim '\r'

2003-10-08 Thread Beckett Richard-qswi266
> > Why not use chop? That removes the last character. > > > > Yes, it certainly does even if the last character is not a > "\r" character. > So to do the work of one good regex substitute operator as > Lee suggested > you would have to determine some how (a regexp match operator?, a > substring

RE: Scrolled notebook page (Tk)

2003-09-29 Thread Beckett Richard-qswi266
AAaaahhh! Thanks Jack. R. > -Original Message- > From: Jack [mailto:[EMAIL PROTECTED] > Sent: 26 September 2003 21:38 > To: [EMAIL PROTECTED] > Subject: Re: Scrolled notebook page (Tk) > > > - Original Message - > From: "Beckett Richard-q

IR port converter

2003-09-24 Thread Beckett Richard-qswi266
Guys, I know this is slightly off topic... There's a program around that allows you to use the IR port on a pc as a com port, under windows 2000. (Apparently under W2K it's a network port). Does anyone know where it is, I really can't find it? Thanks, R. ___

Reading infra red port

2003-09-22 Thread Beckett Richard-qswi266
Guys, One of my hobbies is kart racing, and I've just bought a data logger that records my lap times, gives 3 split times per lap, and records the peak revs for each lap. Currently at the end of a session, I have to write down all the data from the device, then put it into a nice spreadsheet tha

Perl editors

2003-09-22 Thread Beckett Richard-qswi266
What's the best text editor for perl? R. (Trying to keep a straight face). > Just ask "what's the best text editor for perl" and > you'll see :) ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailma

RE: Read a text file and parse values

2003-09-18 Thread Beckett Richard-qswi266
> Friends, > > I got a text file that contains a list of computer names. I > need to write a > program that will read this file and execute following > command for each > computer name: > > exec \\ -u abc -p xxx abc.bat > > where is picked up from the text file. > > Can some one help m

Confused by getOpenFile.

2003-08-29 Thread Beckett Richard-qswi266
Guys, I'm writing a Tk GUI based script, and I am using getOpenFile to load in the file I need to work on. I was just working on a section where I write to a text file the path and name of the last opened file, so that the next time you use the script, it defaults to trying to open the last file

Help with parsing file

2003-08-27 Thread Beckett Richard-qswi266
Guys, I have a large text file, which contains data in the form: parameter name="value" // comment about the line For example: LCD Display Modes="3" // Add the modes to allow them: 1=status 2=aids 4=engine/brake temps I am trying to make a GUI that will allow you to see the parameter, default

Editing text files.

2003-07-30 Thread Beckett Richard-qswi266
Guys, Just knocking up a Tk GUI to read, display and change values in a text file. I've just realised that I don't know how to write the new values back into the text file in the correct location. Anyone point me to where to start? Thanks. R. ___ Per

RE: Perlapp reverse engineering.

2003-07-30 Thread Beckett Richard-qswi266
> Run a debugger. Break right after perl_parse. Dump the OP tree > and feed it to B::Deparse. I have verified this method's validity > with the author of PerlApp. :-) Erm... ?:-) > --- > > There's also an executable that's supposed to convert a

RE: Reading EXCEL Sheet question

2003-07-21 Thread Beckett Richard-qswi266
I tried this, at the top... BEGIN { $SIG{'INT'} = \&handler; } sub handler { $book -> Close (0) if (defined $book); undef $sheet; undef $book; $excel -> Quit if (defined $excel); undef $excel; exit 0; } Then some code that opens excel and takes a

RE: Reading EXCEL Sheet question

2003-07-21 Thread Beckett Richard-qswi266
From: Gianvittorio Negri [mailto:[EMAIL PROTECTED] > Sent: 21 July 2003 13:01 > To: Beckett Richard-qswi266; [EMAIL PROTECTED] > Subject: R: Reading EXCEL Sheet question > > > Many tank's for your answare, but normally thi snippet of > code work as a part of W2K servic

RE: Reading EXCEL Sheet question

2003-07-21 Thread Beckett Richard-qswi266
This is a tricky one, and one I suffered with when my script fell over. I had to go to the Task Manager find and kill the Excel process each time, otherwise I couldn't run Excel up again. I got around it by having an END block like this: END { if (defined $book) {$book -> Close(0)};

RE: Neater?

2003-07-18 Thread Beckett Richard-qswi266
> Masters!? > > Is there a neater way of doing this:? > > my $sheet; > foreach (1, 2, 4) { > $sheet = $_; > print "\$sheet = $sheet\n"; > } > > something along the lines of: > > foreach (my $sheet = (1, 2, 4)) { > print "\$sheet = $sheet\n"; > } > > But this doesn't work as i

FW: [ERR] Neater?

2003-07-18 Thread Beckett Richard-qswi266
Does anyone else see this when they post? Any idea what it is? Should I worry about it? Thanks. R. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 18 July 2003 14:33 > To: Richard Beckett > Subject: [ERR] Neater? > > > Transmit Report: > > To: [EMAIL

Neater?

2003-07-18 Thread Beckett Richard-qswi266
Masters!? Is there a neater way of doing this:? my $sheet; foreach (1, 2, 4) { $sheet = $_; print "\$sheet = $sheet\n"; } something along the lines of: foreach (my $sheet = (1, 2, 4)) { print "\$sheet = $sheet\n"; } But this doesn't work as intended. Thanks. R. __

RE: remove carriage return

2003-07-18 Thread Beckett Richard-qswi266
use strict; use warnings; my $input_file = "input.txt"; open (INFILE, $input_file) or die "Can't open $input_file! $!\n"; my @input = ; foreach (@input) { chomp; next if (/^\D/); print "$_\n"; } > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAI

RE: Excel, hyperlinks and empty rows.

2003-07-10 Thread Beckett Richard-qswi266
> This works for me to return the last populated row -- > > $worksheet_rows = $worksheet->UsedRange->rows->count; Hmmm... Been playing with this. If the sheet has data on it, then it does return the number of the last populated row. If the sheet is empty, it returns 1, which means that I insert

RE: Easy Reg-Ex

2003-07-04 Thread Beckett Richard-qswi266
This works for me... /^Test.*PASS\!$/ Use this little script to check out your pattern matches: while (<>) { chomp; if (/^Test.*PASS\!$/) { print "Matched: |$`<$&>'|\n"; } else { print "No match.\n"; } } R. > -Original Message

RE: -- trouble.

2003-06-17 Thread Beckett Richard-qswi266
> Put the -- in the front instead of the back. D'oh! :-D After _all_ this time, I'm still just a newbie! ;-) Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

-- trouble.

2003-06-17 Thread Beckett Richard-qswi266
Guys, I think I have worked out why the following line doesn't do what I expected it to. I want @all_lines to become @all_lines from 0 up to $line_count minus 1. This line: @all_lines = @all_lines[0..($line_count--)]; I think is making @all_lines become @all_lines from 0 to $line_count, AND T

Another defining variables question.

2003-04-04 Thread Beckett Richard-qswi266
Hello World! I'm using Tk for a GUI, and I have a menu item that opens an instructions window. If I already have the instructions window opened somewhere, I want to bring it to the foreground, rather than opening another window. To this end, I can only see this way of doing it. First, near the

RE: return syntax?

2003-03-31 Thread Beckett Richard-qswi266
> You can call me Bill or $ (dollar) and you can *refer* to me as $Bill, > but don't call me $Bill. :) Hehehe. So, just to check that my brain _is_ working... sub subroutine{ my $return = check_spreadsheet ($which = "large frog"); if ($return eq "Cancel") {return}; ... } sub ch

RE: Functions for clearing screen

2003-03-19 Thread Beckett Richard-qswi266
Please stop CCing me, I read the list. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

OLE Browser.

2003-03-10 Thread Beckett Richard-qswi266
After reading another mail, I have just discovered the OLE browser. Is there any kind of help or tutorial on this, as some things I've looked up are rather cryptic, and don't actually help me much? Or should I remove myself from the Gene pool, as I'm obviously far too stupid to procreate? ;-) Th

RE: TK toplevel display confusion.

2003-02-28 Thread Beckett Richard-qswi266
> I don't have my Tk book here at work, so I can't give you > page numbers, but some things to look at are: I wasn't expecting that, just some words to look up. If you don't know the word, the index is next to useless, unless you go through the whole thing looking up words that might be related.

RE: TK toplevel display confusion.

2003-02-28 Thread Beckett Richard-qswi266
> You can't pack windows. They display automatically. What > you might try > doing is putting this line right after the line I of your > code that I quoted > above: > > $console->withdraw(); Aha! > This should cause the window to hide before being drawn. To cause a > withdrawn window to app

TK toplevel display confusion.

2003-02-28 Thread Beckett Richard-qswi266
Hi Folks. I've just read this... "The widget created by calling MainWindow->new is actually a top level Widget. ... This window is special because it displays itself automatically when you call MainLoop. ... By creating a Toplevel widget, you are creating another window as part of your applicatio

RE: Semicolons.

2003-02-21 Thread Beckett Richard-qswi266
> > Hello. > > > > Why is is that something like this... > > > > if (condition) { > > do something; > > do somethingelse; > > } > > > > doesn't need semicolons after the brackets, but this... > > > > $ftp -> login ($user, $pass) or do { > > error_sub ($_ = "Cannot login to host, use

RE: Regex help

2003-02-18 Thread Beckett Richard-qswi266
> I'm trying to match a string which would start with http://, > then a character string where there is one one or more > instances of "%", followed by one instance of ".com", i.e. > http://www.%55.com > > Here is my current pattern: > http://.*%+.*(\.com) > > However, if there are tw

RE: Trouble with my variables.

2003-02-18 Thread Beckett Richard-qswi266
Still having harassments... I now invoke the sub thusly... update_value("ftp", $ftp{$key}{value}, $key); The sub is like this... sub update_value { $entry{$_[0]}{$key} -> delete (0, "end"); $entry{$_[0]}{$key} -> insert ("end", $_[1]); } I get: Global symbol "$key" requires ex

RE: Trouble with my variables.

2003-02-18 Thread Beckett Richard-qswi266
Thanks, guys. I'm not sure I can explain what I thought, but here's a go... I thought that: If you define a variable with 'my' in the main part of the script, it is available to all parts of that script, including subroutines. In a subroutine, if you define a variable that is only used in that

  1   2   >