Jump to content
Sign in to follow this  
minxomat

StringAPL UDF - Powerful calculations, Minimal code

Recommended Posts

Hi there.

 

Abstract

 

This UDF enables the use of all reference APL features in AutoIt. Is uses the original APL symbols. The code is interpreted via a sandbox ngn-apl interface which relies on JavaScript. Execution is done via IE objects.

 

What's APL?

 

APL is a formal, imperative language. Because it is imperative, a sentence may be called an instruction, and may be executed to produce a result. StringAPL() has one main parameter, which is the APL source code. Thus:

 

 

StringAPL("2×(3+4)") = "14"

Unlike traditionally structured programming languages, code in APL is typically structured as chains of monadic or dyadic functions and operators acting on arrays. As APL has many nonstandard primitives (functions and operators, indicated by a single symbol or a combination of a few symbols), it does not have function or operator precedence.

 

The APL environment is called a workspace. In a workspace the user can define programs and data, i.e. the data values exist also outside the programs, and the user can manipulate the data without the necessity to define a program. For example,

 

 

StringAPL("N ← 4 5 6 7")

will initialize a vector "N" containing 4 elements according to the command. After each StringAPL call, the workspace is deleted completely, so you have to use multi-instructions if you want to reuse macros, functions or variables. Now that we have "N" we can manipulate it. Here's just a small example, you can do much more with APL (later more):

 

 

N+4

Will perform an addition. Every element in N is increased by (int)4. Easy, at least for now ;-)

 

What's possible?

 

Everything. If you feel like it, just draw a mandelbrot fractal using only one line 'o code. Or solve the n-Queen problem, or determine the first hundred prime numbers, or parse a html file. APL is like RegEx on crack. Some really advanced examples are included within the example file.

 

Now, why isn't APL more popular?

 

Because it uses a very, very strange charset. In fact, you have to install the APL Unicode font (https://sites.google.com/site/baavector/fonts) and set SciTe to use this font (CTRL+1 -> Change Monospace Font), before you can even view the examples! In addition to that, you scripts have to be UTF8 BOM encoded, which in return causes Au3Check to crash whenever custom includes are used. I'm planning on replacing the APL chrs with hum-readable english commands, but that may take some time :-)

 

Just look at the mandelbrot drawing code, it's absolutely ridiculous!:

apltestb773.png

 

I'd call it abstract art :D .

 

Examples

 

There are a few examples included. For the basic stuff please visit the Wikipedia APL page und Wikipedia APL reference:

 

examplese923.png

 

Remarks

 

Please do not use the second parameter yet, it is unfinished and experimental. Also, to use multiline-code, use . in-command to start a new line, just like the examples.

 

Download

 

Example file (INSTALL APL FONT AND ENCODE UTF8BOM!!!)

UDF (doesn't need any special treatment, doesn't contain APL chrs)

https://github.com/Perseus-Developers/StringAPL

 

Does not work in 3.3.9.5. Developed in 3.3.8.1. No further testing, please report bugs only if they occur in a stable version.

Edited by minx

I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

Very nice!

You have all APL specific characters in the DejaVu Sans Mono (it is perfect for most fixed-pitch uses, e.g. editors).


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

I just reading about APL

here is some intresting links:

http://forum.apl2000.com/viewtopic.php?f=28&t=942

edit:

http://www.chilton.com/~jimw/setgame.html

edit2:

btw. works on 3.3.10.2 and 3.3.13.19

Edited by mLipok

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

11

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites

Is that font really certified? I didn't try every single one, but most of them seem to have problems with some characters (such as downstile etc.). But if it works: great!

@mLipok Great tutorial here, too: http://www.jsoftware.com/papers/APLDictionary1.htm , also features a great reference.

Edited by minx

I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

One of my first freelance projects was on an IBM 5120 APL... Never worked with APL since but this is a good occasion to start learning the function set again, well if free time permits.

Anyway for those curious enough, this may add significant computing power to AutoIt. I wonder if it would be possible to skip html + IE and launch the .js directly.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

minx,

You're right. There are some functional symbols missing (represented by a thin square), at least in the version I have. I'll try to find a more complete version.

 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Yes, you are right, the bottleneck is IE. Actually, you can spot a google.com tag in the code. This is to bypass the ActiveX filter. But the Site still has to go trough that filter. I think a 3rd party JS compiler will do the job.

Sadly, MS' ScriptControl stopped JS support at version 1.2, so this won't work.


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

11

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites

minx,

I believe you should have mentionned "steepest_learning_curve_language_ever" in the keyword list of your post :mad2:

More seriously I checked the DejaVu site and the last snapshot has a version of DejaVu Sans Mono where all APL symbols defined in Unicode are available (and look correct AFAICT). I don't know which subset implemented in apl.js but that font should cover all practical uses.

I downloaded dejavu-fonts-ttf-2.34-20140118-2580.zip and all worked like a charm. I don't have the setup to compile from latest sources but it doesn't make a big difference for me: work in (slow) progress is on fixing kernings, adding ideographs I can't name and details that don't prevent me from sleeping well.

In SciTE I can see all these 70 APL symbols:

02336    ⌶    APL FUNCTIONAL SYMBOL I-BEAM
02337    ⌷    APL FUNCTIONAL SYMBOL SQUISH QUAD
02338    ⌸    APL FUNCTIONAL SYMBOL QUAD EQUAL
02339    ⌹    APL FUNCTIONAL SYMBOL QUAD DIVIDE
0233A    ⌺    APL FUNCTIONAL SYMBOL QUAD DIAMOND
0233B    ⌻    APL FUNCTIONAL SYMBOL QUAD JOT
0233C    ⌼    APL FUNCTIONAL SYMBOL QUAD CIRCLE
0233D    ⌽    APL FUNCTIONAL SYMBOL CIRCLE STILE
0233E    ⌾    APL FUNCTIONAL SYMBOL CIRCLE JOT
0233F    ⌿    APL FUNCTIONAL SYMBOL SLASH BAR
02340    ⍀    APL FUNCTIONAL SYMBOL BACKSLASH BAR
02341    ⍁    APL FUNCTIONAL SYMBOL QUAD SLASH
02342    ⍂    APL FUNCTIONAL SYMBOL QUAD BACKSLASH
02343    ⍃    APL FUNCTIONAL SYMBOL QUAD LESS-THAN
02344    ⍄    APL FUNCTIONAL SYMBOL QUAD GREATER-THAN
02345    ⍅    APL FUNCTIONAL SYMBOL LEFTWARDS VANE
02346    ⍆    APL FUNCTIONAL SYMBOL RIGHTWARDS VANE
02347    ⍇    APL FUNCTIONAL SYMBOL QUAD LEFTWARDS ARROW
02348    ⍈    APL FUNCTIONAL SYMBOL QUAD RIGHTWARDS ARROW
02349    ⍉    APL FUNCTIONAL SYMBOL CIRCLE BACKSLASH
0234A    ⍊    APL FUNCTIONAL SYMBOL DOWN TACK UNDERBAR
0234B    ⍋    APL FUNCTIONAL SYMBOL DELTA STILE
0234C    ⍌    APL FUNCTIONAL SYMBOL QUAD DOWN CARET
0234D    ⍍    APL FUNCTIONAL SYMBOL QUAD DELTA
0234E    ⍎    APL FUNCTIONAL SYMBOL DOWN TACK JOT
0234F    ⍏    APL FUNCTIONAL SYMBOL UPWARDS VANE
02350    ⍐    APL FUNCTIONAL SYMBOL QUAD UPWARDS ARROW
02351    ⍑    APL FUNCTIONAL SYMBOL UP TACK OVERBAR
02352    ⍒    APL FUNCTIONAL SYMBOL DEL STILE
02353    ⍓    APL FUNCTIONAL SYMBOL QUAD UP CARET
02354    ⍔    APL FUNCTIONAL SYMBOL QUAD DEL
02355    ⍕    APL FUNCTIONAL SYMBOL UP TACK JOT
02356    ⍖    APL FUNCTIONAL SYMBOL DOWNWARDS VANE
02357    ⍗    APL FUNCTIONAL SYMBOL QUAD DOWNWARDS ARROW
02358    ⍘    APL FUNCTIONAL SYMBOL QUOTE UNDERBAR
02359    ⍙    APL FUNCTIONAL SYMBOL DELTA UNDERBAR
0235A    ⍚    APL FUNCTIONAL SYMBOL DIAMOND UNDERBAR
0235B    ⍛    APL FUNCTIONAL SYMBOL JOT UNDERBAR
0235C    ⍜    APL FUNCTIONAL SYMBOL CIRCLE UNDERBAR
0235D    ⍝    APL FUNCTIONAL SYMBOL UP SHOE JOT
0235E    ⍞    APL FUNCTIONAL SYMBOL QUOTE QUAD
0235F    ⍟    APL FUNCTIONAL SYMBOL CIRCLE STAR
02360    ⍠    APL FUNCTIONAL SYMBOL QUAD COLON
02361    ⍡    APL FUNCTIONAL SYMBOL UP TACK DIAERESIS
02362    ⍢    APL FUNCTIONAL SYMBOL DEL DIAERESIS
02363    ⍣    APL FUNCTIONAL SYMBOL STAR DIAERESIS
02364    ⍤    APL FUNCTIONAL SYMBOL JOT DIAERESIS
02365    ⍥    APL FUNCTIONAL SYMBOL CIRCLE DIAERESIS
02366    ⍦    APL FUNCTIONAL SYMBOL DOWN SHOE STILE
02367    ⍧    APL FUNCTIONAL SYMBOL LEFT SHOE STILE
02368    ⍨    APL FUNCTIONAL SYMBOL TILDE DIAERESIS
02369    ⍩    APL FUNCTIONAL SYMBOL GREATER-THAN DIAERESIS
0236A    ⍪    APL FUNCTIONAL SYMBOL COMMA BAR
0236B    ⍫    APL FUNCTIONAL SYMBOL DEL TILDE
0236C    ⍬    APL FUNCTIONAL SYMBOL ZILDE
0236D    ⍭    APL FUNCTIONAL SYMBOL STILE TILDE
0236E    ⍮    APL FUNCTIONAL SYMBOL SEMICOLON UNDERBAR
0236F    ⍯    APL FUNCTIONAL SYMBOL QUAD NOT EQUAL
02370    ⍰    APL FUNCTIONAL SYMBOL QUAD QUESTION
02371    ⍱    APL FUNCTIONAL SYMBOL DOWN CARET TILDE
02372    ⍲    APL FUNCTIONAL SYMBOL UP CARET TILDE
02373    ⍳    APL FUNCTIONAL SYMBOL IOTA
02374    ⍴    APL FUNCTIONAL SYMBOL RHO
02375    ⍵    APL FUNCTIONAL SYMBOL OMEGA
02376    ⍶    APL FUNCTIONAL SYMBOL ALPHA UNDERBAR
02377    ⍷    APL FUNCTIONAL SYMBOL EPSILON UNDERBAR
02378    ⍸    APL FUNCTIONAL SYMBOL IOTA UNDERBAR
02379    ⍹    APL FUNCTIONAL SYMBOL OMEGA UNDERBAR
0237A    ⍺    APL FUNCTIONAL SYMBOL ALPHA
02395    ⎕    APL FUNCTIONAL SYMBOL QUAD
 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Then why bother downloading another font, when there is a more official fully-APL compatible font which is linked in the first post? I can't quite follow your logic there. For the testing of the symbols, just C&P the JSoftware Page I've linked (the last three tables contain the reference) and see if everything is the same. It is for the APL Unicode font (as expected).


I will answer every single PM, and you are free to ask anything anytime.

Share this post


Link to post
Share on other sites

Because the APL fonts is not a good generic programming font and it doesn't contains characters for languages other than limited Latin, limited Greek and limited Cyrillic. It lacks diacritics, modifying letters, way too many symbols and much more. I don't want to have to switch fonts in SciTE so I prefer a "one size fits all" solution.

The advantage of DejaVu Sans Mono is that many of its glyphs have been specifically designed for programming, albeit I agree that APL functionnal symbols are much better rendered in APL385 than elsewhere.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By Skysnake
      Hi
      I am trying to set Accelerator keys from an array.
      I select the KEY and CONTROL from a SQLite table, the Array looks like that generated for the Helpfile, but I can't get the CONTROLS to resolve...
      I though about Assign & Eval, but not sure if that's a step in the right direction. IsDeclared shows that the $var exists in Local Scope -1.  
       
      Local $Main = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idButton_Yes = GUICtrlCreateButton("Yes", 10, 50, 65, 25) Local $idButton_No = GUICtrlCreateButton("No", 80, 50, 65, 25) Local $idButton_Exit = GUICtrlCreateButton("Exit", 150, 50, 65, 25) Local $query, $aResult, $iRows, $iColumns $query = "" ;reset $query = "Select hotkey_key, hotkey_ctrl from mytable where mykeys = 'hotkey' ; " ; ; Query $iRval = _SQLite_GetTable2d($sqliteDb, $query, $aResult, $iRows, $iColumns) If $iRval = $SQLITE_OK Then Local $sizeofHotkeys = UBound($aResult) - 1 ConsoleWrite("$sizeofHotkeys " & $sizeofHotkeys & @CRLF) If $sizeofHotkeys > 0 Then Local $main__aAccelKeys[$sizeofHotkeys][2] For $i = 0 To $sizeofHotkeys - 1 $j = $i + 1 ; replace friendly text with code -- ! alt + Shift ^ Ctrl # Windows $aResult[$j][0] = StringReplace($aResult[$j][0], "Alt", "!") $aResult[$j][0] = StringReplace($aResult[$j][0], "Shift", "+") $aResult[$j][0] = StringReplace($aResult[$j][0], "Ctrl", "^") $main__aAccelKeys[$i][0] = $aResult[$j][0] ;--- $main__aAccelKeys[$i][1] = $aResult[$j][1] ;--- Next ;~ Row|Col 0|Col 1 ;~ Row 0|F2|$idButton_Yes ;~ Row 1|F3|$idButton_No _DebugArrayDisplay($main__aAccelKeys) Local $rv = GUISetAccelerators($main__aAccelKeys, $Main) GUISetState(@SW_SHOW) ; Display the GUI.  
      Please note that this is a modified Helpfile example.
      The Helpfile specifies (a) WinHandle and (b) last Gui created.
      --> the example uses a control not a WinHandle and (b) what happens with ChildGuis? Also, the HelpFile specifies lower case, yet the examples show "{F1}" upper case?
      Also, is there a way to check the result of the GuiSetAccelerator function? 
      Note, if I add these to lines after the FOR loop, then the F1 works, and the DebugArrayDisplays shows control 4... not it's name... So I am in the right place, but my $vars names do not convert to their control numbers in the GUI
      Next $main__aAccelKeys[$sizeofHotkeys - 1][0] = "{F1}" ; -- -- use the extra row for the F1 $main__aAccelKeys[$sizeofHotkeys - 1][1] = $ChmHLP ;--- Skysnake
    • By TrashBoat
      Im trying to iterate through a 2d array created by 
      ProcessList() function that returns a 2d array containing names and pid's, i wanted to filter through the names and delete entries that have "svchost.exe" and this is how i did it
      Func _Sanitize($array) For $x = 1 To UBound($array) - 1 ConsoleWrite($array[$x][0] & @CRLF) If $array[$x][0] == "svchost.exe" Then _ArrayDelete($array, $x) EndIf Next EndFunc ;==>_Sanitize And i get this error message
      What is wrong?
    • By gahhon
      Global Const $DIR_WA_FOLDER = @MyDocumentsDir & '\Whatsapp Extension' Global Const $DIR_SHORTCUT = @DesktopDir & '\WhatsappWeb.exe' Func _Create_Shortcut() Local $sMessage = "Creating shortcut " _Metro_SplashTextScreen(1, "", $sMessage) AdlibRegister("_Metro_LoopInProgress") If FileExists($DIR_WA_FOLDER) Then $iDelete = FileDelete($DIR_SHORTCUT) If $iDelete Then _FileWriteLog($LOG_INSTALLATION, "Debug: Desktop's shortcut is deleted.") Else _FileWriteLog($LOG_INSTALLATION, "Debug: Desktop's shortcut is not found. But, desktop's shortcut is still created.") EndIf If FileExists($DIR_WA_FOLDER & '\WhatsappWeb.exe') Then $iCreate = FileCreateShortcut($DIR_WA_FOLDER & '\WhatsappWeb.exe', $DIR_SHORTCUT) If $iCreate Then _Metro_MsgBox(0, "", "Desktop shortcut is now created!") _FileWriteLog($LOG_INSTALLATION, "Debug: Desktop's shortcut is created.") Else _Metro_MsgBox(0, "", "Desktop shortcut is failed to created!") _FileWriteLog($LOG_INSTALLATION, "Error: Fail to create shortcut.") EndIf Else _Metro_MsgBox(0, "", "Source not found!") _FileWriteLog($LOG_INSTALLATION, "Error: WhatsappWeb.exe is not found.") EndIf Else _Metro_MsgBox(0, "", "Source not found!") _FileWriteLog($LOG_INSTALLATION, "Error: Whatsapp Extension folder is not found.") EndIf AdlibUnRegister("_Metro_LoopInProgress") _Metro_SplashTextScreen(0) EndFunc So I do have a button to trigger this create shortcut to desktop.
      But after it created shortcut at desktop, I cannot execute the shortcut as it has no any response.
      Then I go try trigger the file at the source path @MyDocumentDir & '\Whatsapp Extension\WhatsappWeb.exe' and it work as expected.
      Then I go to check my log, and it shows:- (P/S: I already did trigger the function twice)
      2019-02-28 23:27:32 : Debug: Desktop's shortcut is not found. But, desktop's shortcut is still created. 2019-02-28 23:27:33 : Debug: Desktop's shortcut is created. 2019-02-28 23:28:40 : Debug: Desktop's shortcut is not found. But, desktop's shortcut is still created. 2019-02-28 23:28:41 : Debug: Desktop's shortcut is created. So based on my log shows, it failed to locate the shortcut, but it did exists there.
       
      P/S: This project is done developed weeks ago, every testing is passed. Is just somehow the executable cannot be execute.
       
       
      Any advise?
    • By chrweav86
      Here is an existing AS400 PCOM script that I have: 
      #include-once
      #cs ----------------------------------------------------------------------------
       UDF Header Title: _PCOMM
       UDF Header Version: 0.1.0
       AutoIt Version: 3.3.8.1
       Author:         Jason S. - Jewelry Supply, Inc.
       Script Function: PCOMM UDF Header
                          For use with IBM AS/400 - IBM OS/400 - IBM System i - IBM i application system.
                          This PCOMM UDF Header targets ASW - an ERP application suite written in IBM's RPG language (yuck!),
                          although it will work for any AS/400 system and is not ASW specific.
                          PCOMM allows injection of keystrokes into the datastream of
                          a running terminal/console application ("Green Screen" Console Emulator).
                              - Assumes Session 'A' but can be overriden using the aswConnect() function.
                          PCOMM allows observing of characters in the datastream of a running
                          terminal/console application ("Green Screen" Console Emulator).
                              - Assumes Session 'A' but can be overriden using the aswConnect() function.
      #ce ----------------------------------------------------------------------------
      Global $Session = "A"
      Global $Ps
      Global $Oia
      ; Specify session to connect to
      Func aswSetSession($nSession)
          $Session = $nSession
      EndFunc
      ; Connect to ASW
      ; @param $nSession - Specify session to connect to. Ex: "A"
      Func aswConnect($nSession = $Session)
          $Obj_ConnMgr = ObjCreate("PCOMM.autECLConnMgr")
          $OBJ_EmulSession = ObjCreate("PCOMM.autECLSession")
          $OBJ_EmulSession.SetConnectionByName($nSession)
          $Ps = $OBJ_EmulSession.autECLPS
          $Oia = $OBJ_EmulSession.autECLOIA
      EndFunc
      ; Send Data to ASW
      ; if $rownum and $colnum are not specified, defaults to the cmd line
      Func aswSend($keys, $rownum = 20, $colnum = 7, $inhibit = 1)
          $Ps.SendKeys($keys, $rownum, $colnum)
          if $inhibit = 1 Then
              While $Oia.InputInhibited <> 0
              WEnd
          EndIf
          $Oia.WaitForInputReady()
      EndFunc
      ; Get Data from ASW
      Func aswGet($row, $col, $length)
          $info = $Ps.GetText($row,$col,$length)
          return $info
      Endfunc
      ; Check which page we are on
      ; @param $page - Page to see if we are on. Ex: "DMR30101" == Sales Order Maintenance page
      Func checkScreen($page, $rownum = 1, $colnum = 72, $length = 8)
          If StringInStr(aswGet($rownum, $colnum, $length), $page) Then
              Return 1
          Else
              Return 0
          EndIf
      EndFunc
      I would like to use it launch a connection to the AS400. I have an executable that I run with an hod file. Do I just need to run the exe and hod file then run the session connect function and send keys function to pass credentials?
       
    • By FordsFinest
      Have come across an issue where I use the below code to select and then click an item. It works great on every computer but one, which happens to be my bosses computer (of course right lol).  So SelectItem works fine, but for some reason, the ClickItem command keeps clicking the item below the correct item (but only on this computer. I changed the command to controlsend instead, but i'd rather use the click option.. any ideas here?
       
      _GUICtrlTreeView_SelectItem($hWnd, $Array2[1]) _GUICtrlTreeView_ClickItem($hWnd, $Array2[1], "right")  
×
×
  • Create New...