Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 13:03, ToddAndMargo via perl6-users wrote: On 8/28/22 15:58, ToddAndMargo via perl6-users wrote: Hi All, I am thinking of using     BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code?   If I set

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/28/22 15:58, ToddAndMargo via perl6-users wrote: Hi All, I am thinking of using    BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code?   If I set variable values or declare variables, are they wiped out

Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 19:26, Brad Gilbert wrote: The Raku compiler is written in Raku (to an extent) so no it can't be toned down. I've been out of the loop for a while, but there has been work to make the compiler use a better design which should be more optimizable. Awesome.

Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 19:58, ToddAndMargo via perl6-users wrote: On 8/29/22 19:26, Brad Gilbert wrote: The Raku compiler is written in Raku (to an extent) so no it can't be toned down. I've been out of the loop for a while, but there has been work to make the compiler use a better design which

Re: Ping Larry Wall: excessive compile times

2022-08-30 Thread ToddAndMargo via perl6-users
On 8/30/22 07:45, Parrot Raiser wrote: Surely Jonathan Worthington (or one of the other people who've worked on the compiler) would be in a better position to answer this sort of question. Assuming that you write in a normal "interpreted-language" style, (i.e. gradually adding features, testing,

Re: BEGIN {} question

2022-08-30 Thread ToddAndMargo via perl6-users
On 8/30/22 13:34, Richard Hainsworth wrote: Hi Todd, Long time no see. Re your 'keeper'. There is a reason why things are called the way they are in Raku (aka Perl6). BEGIN is NOT a special subroutine. BEGIN is a phaser. And it introduces a block. Blocks are not subroutines (subs). Even tho

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 00:45, Richard Hainsworth wrote: Work with Raku rather than expect it to be the same as Perl. Oh I intent too! I program in Top Down. Perl 5's subroutines are a nightmare. I ADORE Perl 6's subroutines. By saying above / below, this indicates a linear view of code at the same tim

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 00:45, Richard Hainsworth wrote: Raku and Perl are two different languages in the same family. They evolved with different targets, perl to react quickly to internet requests, Raku to be a better programming language. This may not be the take the actual developers have, but it's what

sprintf and print question

2022-09-01 Thread ToddAndMargo via perl6-users
Hi All, Is there a cleaner way to do this? $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' ande I want to print the first four letter s to STDOUT. -T

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 20:16, Andinus via perl6-users wrote: ToddAndMargo via perl6-users @ 2022-09-01 10:30 -07: On 9/1/22 00:45, Richard Hainsworth wrote: Treat the regexes as data for a program. Compile the program once. Run the regexes as often as you need. Please elucidate. That could save me

Re: sprintf and print question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 19:37, ToddAndMargo via perl6-users wrote: Hi All, Is there a cleaner way to do this?     $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'     ande I want to print the first four letter s to STDOUT. -T $ raku -e 'print

Re: sprintf and print question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/1/22 23:50, ToddAndMargo via perl6-users wrote: On 9/1/22 19:37, ToddAndMargo via perl6-users wrote: Hi All, Is there a cleaner way to do this? $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' ande I want to print the first fo

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it.

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/2/22 00:13, ToddAndMargo via perl6-users wrote: Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it. The guys on the chat line said this is normal as `BEGIN` runs a compile time

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/2/22 13:52, ToddAndMargo via perl6-users wrote: On 9/2/22 00:13, ToddAndMargo via perl6-users wrote: Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it. The guys on the chat line said this is normal as `BEGIN` runs a

Re: BEGIN {} question

2022-09-03 Thread ToddAndMargo via perl6-users
On 9/2/22 18:14, ToddAndMargo via perl6-users wrote: On 9/2/22 13:52, ToddAndMargo via perl6-users wrote: On 9/2/22 00:13, ToddAndMargo via perl6-users wrote: Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it. The guys on the

Re: BEGIN {} question

2022-09-04 Thread ToddAndMargo via perl6-users
On 9/4/22 04:23, Ralph Mellor wrote: On Sun, Sep 4, 2022 at 5:07 AM ToddAndMargo via perl6-users wrote: For the fun of it, I placed a "booboo;" Interesting! You might like to think of `BEGIN` as a signal to the "compiler": "Please do more than just "compile&

Rakudo for W7?

2022-10-20 Thread ToddAndMargo via perl6-users
Hi All, Where can I download the latest Rakudo Star that supports 64 bit Windows 7? Many thanks, -T -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: Aw: Rakudo for W7?

2022-10-22 Thread ToddAndMargo via perl6-users
Gesendet: Freitag, 21. Oktober 2022 um 05:37 Uhr Von: "ToddAndMargo via perl6-users" An: "perl6-users" Betreff: Rakudo for W7? Hi All, Where can I download the latest Rakudo Star that supports 64 bit Windows 7? Many thanks, -T On 10/21/22 08:48, no...@ist-einmalig.de wr

How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
Hi All, Is there a way to print only the last three lines in a long file (full on \n's). In Windows, I am trying to such the last the lines is > dir /s /A:-D /d /a ... Total Files Listed: 13671 File(s) 3,265,285,462 bytes 3917 Dir(s) 18,406,518,784 bytes free An

folder size

2022-10-22 Thread ToddAndMargo via perl6-users
Hi All, Does Raku have a folder size command (including sub folders) or is that a system call? Many thanks, -T -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
On 10/22/22 21:11, Bruce Gray wrote: On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to print only the last three lines in a long file (full on \n's). In Windows, I am trying to such the last the lines is dir /s /A:-D /d /a ...

Re: folder size

2022-10-22 Thread ToddAndMargo via perl6-users
On 10/22/22 22:46, Bruce Gray wrote: On Oct 22, 2022, at 11:30 PM, ToddAndMargo via perl6-users wrote: Hi All, Does Raku have a folder size command (including sub folders) or is that a system call? There are system calls to get sizes of individual files (Raku IO objects provide the

Re: How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
On 10/22/22 22:33, Bruce Gray wrote: dir . /s /A:-D /d /a | raku -e "say lines[*-2].words[2]" It is pretty ! I like it. Thank you!

Re: How do I print the last three lines in a file?

2022-10-23 Thread ToddAndMargo via perl6-users
On 10/22/22 23:26, ToddAndMargo via perl6-users wrote: On 10/22/22 22:33, Bruce Gray wrote: dir . /s /A:-D /d /a  | raku -e "say lines[*-2].words[2]" It is pretty !  I like it.  Thank you! I just verified it works on Windows 7, 10, and 11 You have to be careful to double check.

Re: Aw: Rakudo for W7?

2022-10-23 Thread ToddAndMargo via perl6-users
date where Windows 7 support ended. That seems like a fair method. On Sat, Oct 22, 2022 at 8:18 PM, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: > Gesendet: Freitag, 21. Oktober 2022 um 05:37 Uhr > Von: "ToddAndMargo via perl6

Re: Aw: Rakudo for W7?

2022-10-23 Thread ToddAndMargo via perl6-users
On Sat, Oct 22, 2022 at 8:18 PM, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: > Gesendet: Freitag, 21. Oktober 2022 um 05:37 Uhr > Von: "ToddAndMargo via perl6-users" mailto:perl6-users@perl.org>> > An: "perl

Re: Aw: Rakudo for W7?

2022-10-23 Thread ToddAndMargo via perl6-users
On 10/23/22 15:14, Ralph Mellor wrote: On Sun, Oct 23, 2022 at 1:18 AM ToddAndMargo via perl6-users wrote: Which goes back to my question. What is the last one they published that supports Windows 7? I would say there isn't one, where "supports" is a present tense meaning.

Re: folder size

2022-10-23 Thread ToddAndMargo via perl6-users
On 10/22/22 21:30, ToddAndMargo via perl6-users wrote: Hi All, Does Raku have a folder size command (including sub folders) or is that a system call? Many thanks, -T My final code: sub RunCmd( Str $CommandStr, Bool $EchoOff = False ) { my Str $BatFile = $PathIAm ~ ".bat";

Re: Rakudo for W7?

2022-10-24 Thread ToddAndMargo via perl6-users
On 10/20/22 20:37, ToddAndMargo via perl6-users wrote: Hi All, Where can I download the latest Rakudo Star that supports 64 bit Windows 7? Many thanks, -T I walked through them one at a time to find where they put the artificial block for Windows 7. It was on their last iteration that

Re: folder size

2022-10-24 Thread ToddAndMargo via perl6-users
On 10/24/22 09:14, Parrot Raiser wrote: This https://raku.land/zef:lizmat/path-utils might be what you're seeking. (So new the electrons have barely settled into their new orbits.) Not for this instance, but I can see where this will be really valuable in the future! Thank you!

Re: folder size

2022-10-24 Thread ToddAndMargo via perl6-users
On 10/24/22 10:12, ToddAndMargo via perl6-users wrote: On 10/24/22 09:14, Parrot Raiser wrote: This https://raku.land/zef:lizmat/path-utils might be what you're seeking. (So new the electrons have barely settled into their new orbits.) Not for this instance, but I can see where this wi

Re: folder size

2022-10-24 Thread ToddAndMargo via perl6-users
On Sun, Oct 23, 2022 at 9:56 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 10/22/22 21:30, ToddAndMargo via perl6-users wrote: > Hi All, > > Does Raku have a folder size command (including sub > folders) or is

Re: folder size

2022-10-24 Thread ToddAndMargo via perl6-users
On 10/23/22 21:56, ToddAndMargo via perl6-users wrote: On 10/22/22 21:30, ToddAndMargo via perl6-users wrote: Hi All, Does Raku have a folder size command (including sub folders) or is that a system call? Many thanks, -T My final code: sub RunCmd( Str $CommandStr, Bool $EchoOff = False

how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d But this does not: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ "\n"' aQ[\]bQ[\]cQ[\]d How do I

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 29 Oct 2022, at 22:02, ToddAndMargo via perl6-users wrote: Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d But this does not: $ echo &quo

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 29 Oct 2022, at 23:28, ToddAndMargo via perl6-users wrote: On 29 Oct 2022, at 22:02, ToddAndMargo via perl6-users wrote: Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ &quo

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 10/29/22 13:02, ToddAndMargo via perl6-users wrote: Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d But this does not: $ echo "a/b/c/d

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 10/29/22 14:28, ToddAndMargo via perl6-users wrote: On 10/29/22 13:07, Elizabeth Mattijsen wrote: > $ echo "a/b/c/d" | raku -ne 'say .subst("/", Q/\\\/, :g)' > Hi Elizabeth, Thank you for the subst workaround! I created a keep of the subst.

regex: how to I pick out items in the middle?

2022-10-29 Thread ToddAndMargo via perl6-users
Hi All, With a regex, how do I pick out items in the middle of the string? Two from the beginning or two from the end? 4] > my Str $y="xx"; $y ~~ s/ $([.*-2]) "x"/Q/; print $y ~ "\n" ===SORRY!=== Error while compiling: Malformed postfix call --> my Str $y="xx"; $y ~~ s/ $([.*⏏-2

Re: regex: how to I pick out items in the middle?

2022-10-29 Thread ToddAndMargo via perl6-users
On Sat, Oct 29, 2022 at 6:46 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, With a regex, how do I pick out items in the middle of the string? Two from the beginning or two from the end? 4] > my Str $y="xx"; $y ~~ s/ $([.

Re: regex: how to I pick out items in the middle?

2022-10-30 Thread ToddAndMargo via perl6-users
On 10/29/22 22:37, William Michels via perl6-users wrote: On Sat, Oct 29, 2022 at 7:29 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: >> On Sat, Oct 29, 2022 at 6:46 PM ToddAndMargo via perl6-users >> mailto:perl6-users@perl.org>

Re: regex: how to I pick out items in the middle?

2022-10-30 Thread ToddAndMargo via perl6-users
On 10/29/22 19:16, William Michels via perl6-users wrote: In the Raku REPL: $ raku Welcome to Rakudo™ v2022.07. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2022.07. To exit type 'exit' or '^D' [0] > #beginning Nil [1] > my Str $y="xx"; S/^ x ** 2 /QQ/.say given

Re: regex: how to I pick out items in the middle?

2022-10-30 Thread ToddAndMargo via perl6-users
On 10/30/22 01:24, Elizabeth Mattijsen wrote: Which brings me back to the other of my criticisms of the documentation. The examples are high level users showing off their skills making for a totally useless example for beginners. They should show a simple example and then work up to the show

How do I all an interactive command?

2022-11-07 Thread ToddAndMargo via perl6-users
Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility: hptraidconf query array exit I typically will creating a temporary batch/cmd

Re: How do I all an interactive command?

2022-11-07 Thread ToddAndMargo via perl6-users
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility:     hptraidconf     query

Re: How do I all an interactive command?

2022-11-08 Thread ToddAndMargo via perl6-users
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility:     hptraidconf     query

Re: How do I all an interactive command?

2022-11-08 Thread ToddAndMargo via perl6-users
On 11/8/22 15:04, ToddAndMargo via perl6-users wrote: On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller&#

Exit is going bananas!

2022-11-11 Thread ToddAndMargo via perl6-users
Hi All, Windows 11 Pro 22H2 Rakudo 2022.07 for Windows Is there something about running as an Administrator I need to know about? Rakudo is going bananas with `exit(1)` and plain old `exit` when run as an administrator. Run as a regular user it is fine. Cowardly Exiting. Bummer Dude ... Can

Anyone code WTSSendMessageA?

2022-11-12 Thread ToddAndMargo via perl6-users
Hi All, I am not looking forward to coding WTSSendMessageA. https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea Anyone already do this? Many thanks, -T -- ~~ Computers are like air conditioners. They malfunction when yo

Re: Anyone code WTSSendMessageA?

2022-11-12 Thread ToddAndMargo via perl6-users
On 11/12/22 10:41, ToddAndMargo via perl6-users wrote: Hi All, I am not looking forward to coding WTSSendMessageA. https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea Anyone already do this? Many thanks, -T It about killed me, but I got it coded. Note

Re: Anyone code WTSSendMessageA?

2022-11-12 Thread ToddAndMargo via perl6-users
On 11/12/22 12:49, ToddAndMargo via perl6-users wrote: On 11/12/22 10:41, ToddAndMargo via perl6-users wrote: Hi All, I am not looking forward to coding WTSSendMessageA. https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea Anyone already do this? Many

Session ID

2022-11-14 Thread ToddAndMargo via perl6-users
Hi All, Windows 11 22H2 Is there a way to find session ID of the current running program? Any predefined system variable for that? Many thanks, -T

Re: Exit is going bananas!

2022-11-14 Thread ToddAndMargo via perl6-users
On 11/11/22 21:23, ToddAndMargo via perl6-users wrote: Hi All, Windows 11 Pro 22H2 Rakudo 2022.07 for Windows Is there something about running as an Administrator I need to know about? Rakudo is going bananas with `exit(1)` and plain old `exit` when run as an administrator.  Run as a regular

I can't fid my booboo

2022-11-17 Thread ToddAndMargo via perl6-users
Hi All, I need a second pair of eyes to look at my code and tell me where I messed up. http://vpaste.net/ngl1h raku PopUpTest.pl6 ===SORRY!=== Error while compiling K:\Windows\NtUtil/PopUpTest.pl6 Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at

Re: I can't fid my booboo

2022-11-17 Thread ToddAndMargo via perl6-users
> > On Thu, Nov 17, 2022 at 7:25 PM ToddAndMargo via perl6-users > mailto:perl6-users@perl.org>> wrote: > > Hi All, > > I need a second pair of eyes to look at my > code and tell me where I messed up. > > http://vpaste.net/ngl1h <http://vpast

Re: I can't fid my booboo

2022-11-17 Thread ToddAndMargo via perl6-users
On 11/17/22 21:26, ToddAndMargo via perl6-users wrote: > > On Thu, Nov 17, 2022 at 7:25 PM ToddAndMargo via perl6-users > mailto:perl6-users@perl.org>> wrote: > > Hi All, > > I need a second pair of eyes to look at my > code and tell me whe

What is this handle?

2022-11-19 Thread ToddAndMargo via perl6-users
Hi All, Any of you familiar with native call? In the following C++ HANDLE WTSOpenServerA( [in] LPSTR pServerName ); Is HANDLE a DWORD (32 bit integer)? I just noticed I have HANDLE defined in Raku as constant HANDLE = Pointer[void]; I do believe most C++ pointers are 32 bi

NativeCall pointer question?

2022-11-20 Thread ToddAndMargo via perl6-users
Hi All, In one of my native call, I get returned a pointer to a DWORD (uint32). How do I turn that into the actual value in the DWORD? Many thanks, -T

Re: NativeCall pointer question?

2022-11-20 Thread ToddAndMargo via perl6-users
On Sun, Nov 20, 2022 at 3:48 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, In one of my native call, I get returned a pointer to a DWORD (uint32). How do I turn that into the actual value in the DWORD? Many thanks, -T On 11

Re: What is this handle?

2022-11-21 Thread ToddAndMargo via perl6-users
On Sat, Nov 19, 2022 at 10:13 PM, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, Any of you familiar with native call? In the following C++ HANDLE WTSOpenServerA( [in] LPSTR pServerName ); Is HANDLE a DWO

NativeCall C++ structure question

2022-11-21 Thread ToddAndMargo via perl6-users
Hi All, Windows ChromeBook Edition (W11-22H2). I have been doing a lot of head scratching here. I have a project were I need to use BOOL WTSEnumerateSessionsA( [in] HANDLE hServer, # WTS_CURRENT_SERVER_HANDLE to use the RD Session Host server that hosts your applica

Re: NativeCall C++ structure question

2022-11-21 Thread ToddAndMargo via perl6-users
On 11/21/22 05:01, ToddAndMargo via perl6-users wrote: Hi All, Windows ChromeBook Edition (W11-22H2). I have been doing a lot of head scratching here. I have a project were I need to use     BOOL WTSEnumerateSessionsA(   [in]  HANDLE hServer

Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I read that into a Buf of $ my DWORD $pCount = 0; bytes? my Pointer $ppSessionInf = Pointer.new(); my DWORD $pCount = 32 times some

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
removing my typos: Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I load what $ppSessionInf points to into $Sessions # something gets assigned to it from an API call my Pointer $ppSessionInf =

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
On 11/23/22 18:07, ToddAndMargo via perl6-users wrote: removing my typos: Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I load what $ppSessionInf points to into $Sessions    # something gets

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
On 11/23/22 18:21, Clifton Wood wrote: What type is BYTE, pray tell? constant BYTE := uint8; -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
BYTE of the CArray. What type is BYTE, pray tell? - Cliff On Wed, Nov 23, 2022 at 9:08 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: removing my typos: On 11/23/22 18:22, Clifton Wood wrote: @ToddAndMargo <mailto:toddandma...@zoh

Re: Pointer to bug question

2022-11-24 Thread ToddAndMargo via perl6-users
On 11/23/22 20:01, Clifton Wood wrote: Long story short: my $a = GLib::Roles::TypedBuffer[.new($ppSessionInf); $a.setSize($pCount, :forced); my @sessions = $a.Array; That should return you an array of objects. raku PopUpTest2.pl6 ===SORRY!=== Error while compiling K:\Windows\NtUtil/PopUpT

Re: NativeCall pointer question?

2022-11-24 Thread ToddAndMargo via perl6-users
On Sun, Nov 20, 2022 at 3:48 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, In one of my native call, I get returned a pointer to a DWORD (uint32). How do I turn that into the actual value in the DWORD? Many thanks, -T On 11

bug in REPL

2022-11-24 Thread ToddAndMargo via perl6-users
Fedora 36 rakudo-pkg-2022.7.0-03.x86_64 > use NativeCall > $j =6; $k = CArray[uint8].new(0xFF xx $j ); print $j ~ "\n"; Cannot find method 'qast' on object of type NQPMu REPL does not like the $j.

Bug in NativeCall

2022-11-24 Thread ToddAndMargo via perl6-users
Fedora 36 rakudo-pkg-2022.7.0-03.x86_64 say $ppSessionInf.deref.WHAT; Internal error: unhandled target type

What does this line mean?

2022-11-25 Thread ToddAndMargo via perl6-users
Hi All, I am confused! sub blob-from-pointer(Pointer:D \ptr, Int :$elems!, Blob:U :$type = Buf) is export { What is `Pointer:D \ptr`? Why the `\`? What is `:$elems!`? Why the `:`? Why the `!`? What is `Blob:U :$type = Buf` What does `Blob:U` mean? What does `:type` mean? Is `$type

Re: What does this line mean?

2022-11-26 Thread ToddAndMargo via perl6-users
On 11/25/22 21:06, Bruce Gray wrote: On Nov 25, 2022, at 9:21 PM, ToddAndMargo via perl6-users wrote: Hi All, I am confused! The documentation at https://github.com/salortiz/NativeHelpers-Blob would certainly benefit from example code! No examples in the t/ directory use the `blob-from

What is this "\t"?

2022-11-27 Thread ToddAndMargo via perl6-users
Hi All, On https://github.com/salortiz/NativeHelpers-Blob/blob/master/lib/NativeHelpers/Blob.pm6 Line 96 my \t = ptr.of ~~ void ?? $type.of !! ptr.of; What is `\t`? What of `.of` What is `??`? What is `!!` Yours in confusion. -T

Re: What is this "\t"?

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/27/22 19:02, Clifton Wood wrote: @ToddAndMargo: These are all explained in the Raku documentation. For advanced users that already know what they are doing and do not need it Long story short: "my \t" -- this is a RAW definition. You can use it to hold types, as in this case. ".of"

Re: Pointer to bug question

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/27/22 19:13, Clifton Wood wrote: ToddAndMargo: Why are you referencing NativeHelpers::Blob when I've linked to the code you need. The bug was in the code snippet I've sent. NONE of my stuff is available via zef because CURI (and hence zef) have problems with large scale code that I am sti

Re: What is this "\t"?

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/28/22 17:40, ToddAndMargo wrote: Sigilless variable https://docs.raku.org/language/glossary#Sigilless_variable  Sigilless variables are actually aliases to the  value it is assigned to them, since they are  not containers. Once you assign a sigilless  variable (using th

Re: Pointer to bug question

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/27/22 19:13, Clifton Wood wrote: ToddAndMargo: Why are you referencing NativeHelpers::Blob when I've linked to the code you need. The bug was in the code snippet I've sent. NONE of my stuff is available via zef because CURI (and hence zef) have problems with large scale code that I am sti

Re: What does this line mean?

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/25/22 19:21, ToddAndMargo via perl6-users wrote: Hi All, I am confused! sub blob-from-pointer(Pointer:D \ptr, Int :$elems!, Blob:U :$type = Buf) is export { What is `Pointer:D \ptr`? Why the `\`? What is `:$elems!`? Why the `:`? Why the `!`? What is `Blob:U :$type = Buf

Re: What is this "\t"?

2022-11-29 Thread ToddAndMargo via perl6-users
On 11/29/22 01:13, Francis Grizzly Smit wrote: Personally I never use \name are I hate how it looks, and so far I have never needed it, so unless I can find something it can do that I cannot do any other way, I'll keep on not using it I have seen it use and it was sneaky as all heck. Very cle

NativeCall and pointers question

2022-11-30 Thread ToddAndMargo via perl6-users
Hi All, In the following: use NativeCall; constant BYTE := uint8; constant LPDWORD := uint64;# long pointer to a DWORD constant LPSTR= CArray[BYTE]; # long pointer to a string constant DWORD:= uint32; constant HANDLE = Pointer[void]; sub WTSOpenServerA( #`{ https://l

Re: NativeCall and pointers question

2022-11-30 Thread ToddAndMargo via perl6-users
Let me ask this question a little simpler: 1) how to I tell NativeCall I only want the C pointer back, not what it points to? 2) how do I tell NativeCall I am sending it a C pointer? Many thanks, -T

When to use .new?

2022-11-30 Thread ToddAndMargo via perl6-users
Hi All, Why can I get away with my Str $x = ""; But I have to use .new here (an other places too) my $ppSession = NativeCall::Types::Pointer.new(); Is there some rule I can follow that let me know when I have to use .new and when I do not? (I am getting tired of figuring it out the har

Re: NativeCall and pointers question

2022-11-30 Thread ToddAndMargo via perl6-users
On 11/30/22 12:53, ToddAndMargo via perl6-users wrote: Let me ask this question a little simpler: To answer my own questions, which I figured out the hard way. 1) how to I tell NativeCall I only want the C pointer back, not what it points to? By declaring it as a pointer and creating it

Tip: use of pointers example

2022-12-01 Thread ToddAndMargo via perl6-users
Hi All, Windows 11 pro 22H2 The following is a test example of the use of pointers for calling Windows DLL's and for copying data out of structures when given a pointer to the structure. Before you tell me there is an easier way to get the computer name out of "GetComputerNameA," this is to sho

pointer confusion

2022-12-03 Thread ToddAndMargo via perl6-users
Hi All, NativeCall question: I am confused about how to assign an address to a pointer [1] > use lib '.'; use NativeCall; use NativeConstants Nil [2] > my $x=0xFE45DDCC; 4265991628 [3] > my Pointer $Ptr2Ptr = NativeCall::Types::Pointer[BYTES].new($x); NativeCall::Types::Pointer<0xfe45dd

Re: Session ID

2022-12-05 Thread ToddAndMargo via perl6-users
On 11/14/22 12:54, ToddAndMargo via perl6-users wrote: Hi All, Windows 11 22H2 Is there a way to find session ID of the current running program?  Any predefined system variable for that? Many thanks, -T Answer 3: https://stackoverflow.com/questions/74665162/how-do-i-assign-the-value-in

Re: Session ID

2022-12-05 Thread ToddAndMargo via perl6-users
On 12/5/22 09:17, Ralph Mellor wrote: On Mon, Dec 5, 2022 at 9:45 AM ToddAndMargo via perl6-users wrote: Answer 3: https://stackoverflow.com/questions/74665162/how-do-i-assign-the-value-in-carray-that-contains-a-memory-address-to-a-poi#74674303 Håkon Hægland is astonishing good at this stuff

Re: pointer confusion

2022-12-05 Thread ToddAndMargo via perl6-users
On 12/5/22 09:25, Ralph Mellor wrote: On Sat, Dec 3, 2022 at 11:44 AM ToddAndMargo via perl6-users wrote: I am confused I think the following is a golf of your confusion: ``` use NativeCall; my Pointer $foo .= new: 42; say $foo; # NativeCall::Types::Pointer<0x2a> print $foo; # Nati

Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
Hi All, Windows Pro Chromebook Edition 22H2 (W11) raku -v Welcome to RakudoΓäó v2022.07. When ever I run the following, it opens a Notepad with the text of the calling raku program. raku -e "use lib '.'; use NativeWinUtils :RunCmd; say RunCmd(Q[ls]);" This is RunCmd sub RunCmd( Str $Command

Re: Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
If those are true, then this code: ``` use lib '.'; use NativeWinUtils :RunCmd; say RunCmd(Q[ls]); ``` is NOT running the code you showed starting `sub RunCmd`. -- raiph On Tue, Dec 6, 2022 at 9:44 AM ToddAndMargo via perl6-users wrote: Hi All, Windows Pro Chromebook Edition 22H2 (W

Re: Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/6/22 03:13, ToddAndMargo via perl6-users wrote: On 12/6/22 02:40, Ralph Mellor wrote: Please confirm that: * Entering `ls` at the command line prompt does what it says    on the tin, it does not open notepad. * A Raku program that consists of the single line `qqx 'ls'` does

Re: Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/6/22 03:31, ToddAndMargo via perl6-users wrote: On 12/6/22 03:13, ToddAndMargo via perl6-users wrote: On 12/6/22 02:40, Ralph Mellor wrote: Please confirm that: * Entering `ls` at the command line prompt does what it says    on the tin, it does not open notepad. * A Raku program that

Re: Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/6/22 03:31, ToddAndMargo via perl6-users wrote: This is obviously not a raku issue, but a Windows issue. I think I misspoke. I do believe qqx is trying to run the sub from the module. I will put together a few tests in a couple of days to see if I can get it to repeat, then I will tag

Re: Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/6/22 01:44, ToddAndMargo via perl6-users wrote: Hi All, Windows Pro Chromebook Edition 22H2  (W11) raku -v  Welcome to RakudoΓäó v2022.07. When ever I run the following, it opens a Notepad with the text of the calling raku program. raku -e "use lib '.'; use NativeWinUti

Re: Raku opens a notepad when executing a .bat

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/6/22 07:31, ToddAndMargo via perl6-users wrote: On 12/6/22 01:44, ToddAndMargo via perl6-users wrote: Hi All, Windows Pro Chromebook Edition 22H2  (W11) raku -v  Welcome to RakudoΓäó v2022.07. When ever I run the following, it opens a Notepad with the text of the calling raku program

Re: pointer confusion

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/5/22 16:35, Ralph Mellor wrote: On Mon, Dec 5, 2022 at 10:20 PM ToddAndMargo via perl6-users wrote: use NativeCall; my Pointer $foo .= new: 42; say $foo; # NativeCall::Types::Pointer<0x2a> print $foo; # NativeCall::Types::Pointer<5895604297984> `say` concatenates

Re: pointer confusion

2022-12-06 Thread ToddAndMargo via perl6-users
On 12/6/22 15:40, ToddAndMargo via perl6-users wrote: On 12/5/22 16:35, Ralph Mellor wrote: On Mon, Dec 5, 2022 at 10:20 PM ToddAndMargo via perl6-users wrote: use NativeCall; my Pointer $foo .= new: 42; say $foo;   # NativeCall::Types::Pointer<0x2a> print $foo; # NativeCall::Types::P

"returns" question

2022-12-07 Thread ToddAndMargo via perl6-users
Hi All, On my sub declarations, I like to use "export" sub abc() returns Str {...} becasue it makes eh sub easier to figure out at a glance when I go to maintain it. Two exports I have not figured out are 1) an array, 2) an object created from a custom class. returns @ gets the

<    1   2   3   4   5   6   7   8   9   10   >