Re: OLE methods with output arguments
On Fri, 22 Nov 2002 10:37:52 -0500, Jon Vinson [EMAIL PROTECTED] wrote: Figured it out. Answer: Variant(VT_VARIANT | VT_BYREF, Variant(VT_EMPTY)) (Good grief!) Yes. But then, passing arguments by reference is rarely done in OLE Automation. Anyways, I've added a shortcut (for some value of short) for the expression above to Win32::OLE in ActivePerl 634/803: Variant(VT_VARIANT | VT_BYREF); Still quite a mouthful though... Cheers, -Jan ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Excel to html format
Title: Excel to html format Maybe you should use Excel's built in Visual Basic for that task. You can open a workbook including a auto_open macro that grabs your desired information and writes the HTML-File. And you don't have to take care about your version of Excel since VB in every version is able to read cells and write files... I've got suchkind of solution which works fine for my purposes... Harry -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ricci, MarkSent: Monday, November 25, 2002 10:13 PMTo: [EMAIL PROTECTED]Subject: Excel to html format Hello, I have an Excel spreadsheet that a person saves to a network drive daily. I want to automate the task of opening the file and saving it as html (the person can't do it themselves, their not technical enough! ). I know the OLE modules can let you manipulate the data in a spreadsheet but can it save the file as html? Thanks in advance, Mark This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message. Thank you. WordWave, Capturing the Power of the Spoken Word http://www.wordwave.com
Re: Justifying text in a Tk label?
Than your pane is just centerd, and not the lable. Try to set the pane over the full size ( mybe with a frame -pack(-side='top' -fill='x', -expand=1); kris On 25.11.2002 17:50 Uhr, Beckett Richard-qswi266 [EMAIL PROTECTED] wrote: That doesn't seem to work, either. Thanks. R. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 25 November 2002 16:45 To: Beckett Richard-qswi266 Subject: Re: Justifying text in a Tk label? try 'align=' greets kris On 25 Nov 2002 at 15:23, Beckett Richard-qswi266 wrote: Anyone know how to justify the text within a Tk label? I tried many combinations, like: my $label = $frame-Label (-text = Hostname :, -relief = raised, -borderwidth = 2, -width = 25, -justify = left) - pack (-side = top, -anchor = e, -padx = 1, -pady = 1); But I couldn't make any difference, the text is always centered. Thanks. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Justifying text in a Tk label?
Aha! Thanks guys! This is what I was trying to do, the part with the shorter label... # use Tk; my $mw=tkinit; my $label=$mw-Label( -text= 'This is a very long, long, long label.', -relief='groove'); $label-pack( -side='top', -fill='both', -expand='both'); my $label1=$mw-Label( -text='This is a short label.', -anchor='e', -justify='left', -relief='groove'); $label1-pack( -side='top', -fill='both', -expand='both'); MainLoop; I think I missed the fact that you can use -anchor within the Label command, and was only using it within the pack command. The way Tk packs stuff is really tricky, isn't it! Thanks, again. R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Excel to html format
On 25/11/2002 21:13:28 perl-win32-users-admin wrote: Hello, I have an Excel spreadsheet that a person saves to a network drive daily. I want to automate the task of opening the file and saving it as html (the person can't do it themselves, their not technical enough! ). I know the OLE modules can let you manipulate the data in a spreadsheet but can it save the file as html? If I were you, I'd extract the data from the spreadsheet and write the HTML from Perl. The $expletive produced by Excel claiming to be HTML is just awful (and Office 2000 is even worse). If you do save from Excel, make sure you run the resulting file through HTML Tidy. -- Csaba Ráduly, Software Engineer Sophos Anti-Virus email: [EMAIL PROTECTED]http://www.sophos.com US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933 ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
PPM problems with ActiveState 5.8.0
I have installed ActiveState Perl 5.8.0 build 802 and have noticed the (Bshell prompt when you start PPM seems to be wrong. Instead of: (B (BPPM (B (BI get: (B $B"+(B[4;mppm $B"+(B[1m $B"+(B[0m$B"+(B[4;mppm $B"+(B[1m (B (BAny ideas why? (B (BThanks, (B (BPhil Morley (B (B (B (B___ (BPerl-Win32-Users mailing list ([EMAIL PROTECTED] (BTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: PPM problems with ActiveState 5.8.0
These are ANSI escape codes. Make a search on Google on these keywords if it is not clear to you what they are. Why PPM is trying to make use of them is another question though. What is your platform ? _ Bruno Bellenger Sr. Network/Systems Administrator -Original Message- From: Philip Morley [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 12:57 PM To: [EMAIL PROTECTED] Subject:PPM problems with ActiveState 5.8.0 I have installed ActiveState Perl 5.8.0 build 802 and have noticed the shell prompt when you start PPM seems to be wrong. Instead of: PPM I get: ?[4;mppm ?[1m ?[0m?[4;mppm ?[1m Any ideas why? Thanks, Phil Morley ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: thread limit in fork?
I'm *really* confused now. I've read topic after topic on this list saying that fork doesn't work on Windows. I've tried some trivial examples and it work. Other's have written that it works in some case but not all. One note said that a program worked most of the time but occasionally gets all forked up. What's the official word on 5.6.1 (build 633). -Original Message- From: Jan Dubois [mailto:[EMAIL PROTECTED]] Sent: Monday, November 25, 2002 16:45 PM To: prefab Cc: [EMAIL PROTECTED] Subject: Re: thread limit in fork? Importance: Low On Mon, 25 Nov 2002 15:09:26 -0800 (PST), prefab [EMAIL PROTECTED] wrote: Does anyone know where this limit comes from and if it is possible to configure a higher number of threads? Yes, there is a limit of 64 *concurrent* threads in Perl on Windows. The limit comes from using the WaitForMultipleObjects() API for the implementation of the wait() function. It would be possible to do better by e.g. chaining multiple blocks of 64 handles together using event semaphores, but somebody has to actually do it. It is not as easy as just changing a constant and recompiling the sources. Patches welcome! :) Note that you must use wait/waitpid to reap your forked children. Otherwise the slots in the thread table won't become available again for new threads. Cheers, -Jan ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Net-DNS for 5.8/802
Does anybody know where I can find a Net-DNS module built for ActivePerl build 802? I'm not in dire need, but it'd be nice. perl -e sub Sub{return reverse(@_);}$i='ohce';$_='.$yyye k ca i Xl $yyye jX $yyyehto ZfX tq $uQ';s+[ \$]++g;s-j-P-;s^yyy^r^g;s:i:H:;s!X! !g;s|Z|n|;s*Q*J*;s{q}{s}g;s(f)(A);system(join('',Sub(split('',$i))),(joi n('',Sub(split(''); To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the engineer, the glass is twice as big as it needs to be. Adrian Okay, I won't top-post unless it's an emergency Stovall ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Substitution
Either quote the meta characters in the search string by enclosing it in \Q \E sequences or quote each meta separtately by preceeding it with a \ character, e.g. s!\Q$search\E!$replace!; or @search=split(//,$search); foreach $char (@search) { $char=\\$char if $char=~/\W/; } $search=join('',@search); I still couldn't get it to work. Here is my code so you can see where I am messing up: # Get the original record from a hidden field my $record = $cgi-param('oldval'); # Search the database, and grab the old values for the record to be modified open (OLD, $file) or die Cannot open $file: $!\n; while (OLD){ $oldline = $_; if ($oldline =~ /^$record(.*)$/) { ($orig_cat_num, $orig_link, $orig_name, $orig_file, $orig_title, $orig_composer, $orig_arranger, $orig_publisher, $orig_price, $orig_description) = split(/\:/, $oldline); # Store the value of this line in the search variable $search = $oldline; } } # Close the file close (OLD); # Grab the new values from the form $cat_num = $cgi-param('cat_num'); $title = $cgi-param('title'); $composer = $cgi-param('composer'); $arranger = $cgi-param('arranger'); $publisher = $cgi-param('publisher'); $price = $cgi-param('price'); $description = $cgi-param('description'); # Get rid of all the line enders in the description $description =~ s/\n/\br\/g; my $replace = $cat_num:$orig_link:$orig_name:$title:$composer:$arranger:$publisher:$price :$description\n; open (OFILE, $file) or print brCannot write the database; open (TEMP, $tmp) or die Cannot create temp file: $!\n; select (TEMP); my $out = ''; # Print all the lines of text from the db file directly into the temp file, # including the record header we are looking for while (OFILE){ my $line = $_; if ($line =~ /^$record(.*)$/i) { chomp $line; # Substitute the old values for the new $line =~ s!\Q$search\E!$replace!; # This still shows the old value!!! die Replacing with $line\n; $out .= $_; } $out .= $_; } print TEMP $out; Now, as I mentioned before, the contents of $line would look like: ../pdf/sax_quartet/BMP0016.pdf:BMP0016.pdf:No baile mas (Dance No More):Cervantes:O'Briant:Bayside Music Press:$8.00:descBR Where am I going wrong? -Erich- ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: PPM problems with ActiveState 5.8.0
|-+--- | | Bellenger, Bruno (Paris) | | | [EMAIL PROTECTED] | | | Sent by:| | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 26/11/02 13:17 | | | | |-+--- | | | |To: [EMAIL PROTECTED] | |cc: 'Philip Morley' [EMAIL PROTECTED] | |Subject: RE: PPM problems with ActiveState 5.8.0 | | These are ANSI escape codes. Make a search on Google on these keywords if it is not clear to you what they are. Why PPM is trying to make use of them is another question though. What is your platform ? I am using Windows NT 4.0. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Excel to html format
Hello, I have an Excel spreadsheet that a person saves to a network drive daily. I want to automate the task of opening the file and saving it as html (the person can't do it themselves, their not technical enough! ). I know the OLE modules can let you manipulate the data in a spreadsheet but can it save the file as html? I'm sure you could easily modify the below code to add some html tags and print to a file ... From the Spreadsheet::ParseExcel docs: use strict; use Spreadsheet::ParseExcel; my $oExcel = new Spreadsheet::ParseExcel; #1.1 Normal Excel97 my $oBook = $oExcel-Parse('Excel/Test97.xls'); my($iR, $iC, $oWkS, $oWkC); print FILE :, $oBook-{File} , \n; print COUNT :, $oBook-{SheetCount} , \n; print AUTHOR:, $oBook-{Author} , \n; for(my $iSheet=0; $iSheet $oBook-{SheetCount} ; $iSheet++) { $oWkS = $oBook-{Worksheet}[$iSheet]; print - SHEET:, $oWkS-{Name}, \n; for(my $iR = $oWkS-{MinRow} ; defined $oWkS-{MaxRow} $iR = $oWkS-{MaxRow} ; $iR++) { for(my $iC = $oWkS-{MinCol} ; defined $oWkS-{MaxCol} $iC = $oWkS-{MaxCol} ; $iC++) { $oWkC = $oWkS-{Cells}[$iR][$iC]; print ( $iR , $iC ) =, $oWkC-Value, \n if($oWkC); # Formatted Value print ( $iR , $iC ) =, $oWkC-{Val}, \n if($oWkC); # Original Value } } } ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Excel to html format
I will second the motion for Spreadsheet::ParseExcel. I have been working with statistical tables lately and have built a set of modules that takes Excel files as input and outputs valid XHTML 1.0 tables that are ADA Section 508 compliant. Recent versions of Spreadsheet::ParseExcel have worked flawlessly. An added advantage is that it is pure Perl, so having Excel on the machine is not necessary. I currently run mine on Solaris. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Excel to html format
[EMAIL PROTECTED] wrote: snip! The $expletive produced by Excel claiming to be HTML is just awful (and Office 2000 is even worse) You got that right. When HTMLizing Put the CD in the CD drive with Word2K, we got Put the CD in the addressCD drive/address. If you do save from Excel, make sure you run the resulting file through HTML Tidy. Definitely. If it will take it. Last time I tried the HTMLTidy embedded in HTML-Kit with Word2K-generated HTML, it died horribly. Maybe you need a more recent HTMLTidy than is embedded in HTML-Kit. Or use OpenOffice.org. Both word processor and spreadsheet produce better HTML than the corresponding MS-office products. Well, they actually _produce_ html (the MS ones do XML, as the humorous but apposite example above illustrates). Anyhow, for the same 5-row by 2-column spreadsheet, OpenOffice produced 50 lines of HTML, and Excel produced 150 lines of XML. But unfortunately I have no experience with OLE to OpenOffice. Tom Wyant This communication is for use by the intended recipient and contains information that may be privileged, confidential or copyrighted under applicable law. If you are not the intended recipient, you are hereby formally notified that any use, copying or distribution of this e-mail, in whole or in part, is strictly prohibited. Please notify the sender by return e-mail and delete this e-mail from your system. Unless explicitly and conspicuously designated as E-Contract Intended, this e-mail does not constitute a contract offer, a contract amendment, or an acceptance of a contract offer. This e-mail does not constitute a consent to the use of sender's contact information for direct marketing purposes or for transfers of data to third parties. Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean http://www.DuPont.com/corp/email_disclaimer.html ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Excel to html format
But unfortunately I have no experience with OLE to OpenOffice. Tom Wyant Which brings up an interesting question that's been on my mind lately. I don't know, but I would bet that OO doesn't even have an OLE interface. Has anyone been able to do any automation at all using OO on either Win32 or Linux? I've been recommending it to my fellow penny-pinchers as good MSOffice replacement, but I haven't checked its automation capabilities. What can (or can't) it do? Can I control it from Perl? jpt ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: PPM problems with ActiveState 5.8.0
On Tue, 2002-11-26 at 03:57, Philip Morley wrote: I have installed ActiveState Perl 5.8.0 build 802 and have noticed the shell prompt when you start PPM seems to be wrong. Instead of: PPM I get: ←[4;mppm ←[1m ←[0m←[4;mppm ←[1m Any ideas why? I don't know what may be causing this problem. If this is a problem with PPM, I'd like to get it identified and fixed. Have you used PPM from any of the ActivePerl 6xx builds? Did they display this problem? Starting with ActivePerl 8xx, 'ppm' runs PPM3, while 'ppm2' runs the older PPM2. In ActivePerl 6xx, 'ppm' ran PPM2, while 'ppm3' ran PPM3. If you sill have access to a ActivePerl 6xx installation, can you try running ppm3 and see if this problem exists? Are you running a 3rd party command shell? Finally, can you run the command 'set' in a command window and send me the output please? Thanks! ds Thanks, Phil Morley ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Opening multiple files in parallel
I am developing an application where I am importing data from 4 separate flat files. A single record spans across all four of the files. I would like to be able to open all 4 files in parallel to make it easier to process them at the same time. The code I would like to use is: # Open files for (my $file_num = 1; $file_num 5; $file_num++) { my $in_fn = Form . $file_num . Export.CSV; print $in_fn\t; open IN_FILE[$file_num], . $in_fn || die unable to open $in_fn: $!\n; } ## end of for (my $file_num = 1; $file_num 5; $file_num++) However, I get the following syntax error: Missing comma after first argument to open function at qt.pl line 29, near unable to open $in_fn: $!\n; Is there a workaround? James H. Cutts IIIIntegrated Technology Services Computer Project Manager Research and Education Support Phone: (573) 882-6181 University of Missouri - Columbia FAX: [573] 884=8192 DC017.00, 265H Quarterdeck Columbia, MO 65212 E-Mail: [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs