Hello Guest it is March 28, 2024, 07:15:00 AM

Author Topic: Want help for VBS in Mach3  (Read 4222 times)

0 Members and 1 Guest are viewing this topic.

Want help for VBS in Mach3
« on: July 06, 2011, 03:36:49 AM »
I want to implament a function: wait user input name and password, so I write a code like follow:
Sub Main ()
    Begin Dialog DialogName1 60, 60, 160, 70, "ASC - Hello"
        TEXT 10, 10, 28, 12, "Name and password:"
        TEXTBOX 42, 10, 108, 12, .strName
        TEXTBOX 42, 24, 108, 12, .strPass
        OKBUTTON 42, 54, 40, 12
    End Dialog
    Dim Dlg1 As DialogName1
    Dialog Dlg1
End Sub

for the password ,I know Textbox in VB can support a property named "Passwordchar" , when I use VB and other program language, I write TextBox1.PasswordChar="*",
it will be work ,but in Mach3 VBS I don't know where can I write this code
thank you!!!
Re: Want help for VBS in Mach3
« Reply #1 on: July 06, 2011, 06:29:20 AM »
Mach3 doesn't actually use VB, even though that's what most people have been calling it. Mach3 really uses CB, Cypress Basic, which is very similar to VB because they are both Basic languages. Just like different versions of C/C++ - not all are created equal. I've used quite a few different flavours of Basic, and all of them have slightly different features.

To my knowledge CB doesn't have a "Passwordchar" property, or any password support that I'm aware of. You will have to be creative if you want to implement password obfuscation (printing * on the screen to protect the password).

I would take a look at AutoHotkey. You could actually have the function call the autohotkey script (using a shell statement to execute your compiled .exe from autohotkey)  and the autohotkey script could be used to control the username and password, and it does support password obfuscation.

Maybe there's a better solution, this is just what came to mind off the top of my head.

Hope this helps a little,

Chris
Re: Want help for VBS in Mach3
« Reply #2 on: July 06, 2011, 07:48:52 PM »
 thank you Sargon ,I first hear about CB ,so many thanks!  I will learn some for it.
if I only can use SDK to write code to do so?
Re: Want help for VBS in Mach3
« Reply #3 on: July 06, 2011, 08:38:55 PM »
Mach3 supports CB scripting as well as C++ plugins. You can see all the details and specifications in the documentation at http://www.machsupport.com/documentation.php.

Also check out the Mach3 wiki at http://www.machsupport.com/MachCustomizeWiki/index.php?title=Main_Page