hexagon logo

Please help/guide/or just do it; Basic script to open other basic scripts

I am not providing a code sample, but at the end of this I hope one will exist. Ultimately I want a .BAS that opens a dialog that allows me to execute other .BAS files I have created. It'd be great if they can be assigned to buttons instead of a file selection dialog.

I want this functionality because the PC-DMIS toolbars don't work properly- they lose the icon leaving a blank toolbar- leaving me to guess what is what. With a .BAS like the one I have described I can assign just one user defined command and not care that it is a blank icon.

Is anyone versed enough in BASIC to help me with this?
Parents
  • Ultimately I want a .BAS that opens a dialog that allows me to execute other .BAS files I have created.


    I tried something similar (trying to keep everything inside PcDmis) but abandoned the effort due to the limited functionality of Cypress and it's GUI. Instead, I have a single toolbar BAS file that calls a EXE (compiled AutoIt) that launches Excel, opens a workbook and loads a tabbed form. The form has command buttons for different scripts (sometimes with additional dialogs). For me, it's easier to manage and changes can be made on the fly. It lets me keep the little code I have all in one place.

    BAS that calls the EXE which starts Excel...
    Sub Main()
    	Dim oApp as Object
    	Dim sPath as String
    	
    	Set oApp = CreateObject("PCDLRN.Application")
    	sPath = oApp.GetRegistryString("Option", "SubroutineUserSearchDirectory", "Nada")
    	Set oApp = Nothing
    	
    	sPath = sPath & "RunPcDmisMacros.exe"
    	Shell ( sPath )
    	
    End Sub


    Thanks to AndersI for mentioning AutoIt in other posts. A really valuable tool that's also been helpful outside of PcDmis.
Reply
  • Ultimately I want a .BAS that opens a dialog that allows me to execute other .BAS files I have created.


    I tried something similar (trying to keep everything inside PcDmis) but abandoned the effort due to the limited functionality of Cypress and it's GUI. Instead, I have a single toolbar BAS file that calls a EXE (compiled AutoIt) that launches Excel, opens a workbook and loads a tabbed form. The form has command buttons for different scripts (sometimes with additional dialogs). For me, it's easier to manage and changes can be made on the fly. It lets me keep the little code I have all in one place.

    BAS that calls the EXE which starts Excel...
    Sub Main()
    	Dim oApp as Object
    	Dim sPath as String
    	
    	Set oApp = CreateObject("PCDLRN.Application")
    	sPath = oApp.GetRegistryString("Option", "SubroutineUserSearchDirectory", "Nada")
    	Set oApp = Nothing
    	
    	sPath = sPath & "RunPcDmisMacros.exe"
    	Shell ( sPath )
    	
    End Sub


    Thanks to AndersI for mentioning AutoIt in other posts. A really valuable tool that's also been helpful outside of PcDmis.
Children
No Data