How do I execute Win32 functions?
7 posts
• Page 1 of 1
How do I execute Win32 functions?
How do I execute Win32 functions?
For instance, in APL+Win I can execute the Windows GetTempPath function to query the user's temp directory with:
How does one do this in Dyalog?
(I am a very experienced APL programmer, but new to Dyalog.)
For instance, in APL+Win I can execute the Windows GetTempPath function to query the user's temp directory with:
⎕WCALL 'GetTempPath' 128 (128⍴⎕TCNUL)
32 C:\Users\rex\AppData\Local\Temp\
How does one do this in Dyalog?
(I am a very experienced APL programmer, but new to Dyalog.)
- rex
- Posts: 12
- Joined: Sat Jun 10, 2023 10:49 pm
Re: How do I execute Win32 functions?
Hi Rex,
this would be ⎕NA, for Name Association
There is a QuadNA.dws with examples in the namespace Windows.
Greetings,
JoHo
this would be ⎕NA, for Name Association
There is a QuadNA.dws with examples in the namespace Windows.
Greetings,
JoHo
-
JoHo - Posts: 37
- Joined: Sat Nov 28, 2009 12:51 pm
- Location: Austria, EU
Re: How do I execute Win32 functions?
Thanks a lot -- that will get me started.
- rex
- Posts: 12
- Joined: Sat Jun 10, 2023 10:49 pm
Re: How do I execute Win32 functions?
copied from the ⎕NA docu, "more examples":
- Code: Select all
⎕←GetTempDir''
C:\Users\Alpha\AppData\Local\Temp\
⎕VR'GetTempDir'
∇ {temp}←GetTempDir dummy;get;size
[1] 'get'⎕NA'U4 kernel32|GetTempPath* U4 >0T' ⍝
[2] (size temp)←get 128 128
∇
-
JoHo - Posts: 37
- Joined: Sat Nov 28, 2009 12:51 pm
- Location: Austria, EU
Re: How do I execute Win32 functions?
Of course, for this specific example, there's
- Code: Select all
739⌶0 ⍝ Return temporary dir name on this o/s
/tmp
- petermsiegel
- Posts: 159
- Joined: Thu Nov 11, 2010 11:04 pm
Re: How do I execute Win32 functions?
If you don't mind using .Net here is what I am using:
To start a Win32 function:
To get the TempPath:
To start a Win32 function:
- Code: Select all
⎕USING∪←⊂',System.dll'
sink←System.Diagnostics.Process.Start(⊂'notepad.exe')
sink←System.Diagnostics.Process.Start(⊂'calc.exe')
sink←System.Diagnostics.Process.Start(⊂'C:\Program Files (x86)\Dyalog')
To get the TempPath:
- Code: Select all
⎕USING∪←⊂',mscorlib.dll'
System.IO.Path.GetTempFileName
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: How do I execute Win32 functions?
Ha ha -- the usual APL situation:
many possible solutions, quite different from each other.
Thank you, everyone.
many possible solutions, quite different from each other.
Thank you, everyone.
- rex
- Posts: 12
- Joined: Sat Jun 10, 2023 10:49 pm
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group