Hello Guest it is April 19, 2024, 09:55:04 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hdscarbro

Pages: 1 2 »
1
VB and the development of wizards / Re: File open dialog
« on: October 12, 2012, 12:33:33 PM »
This is an old thread, but it seems like the best place to post some new info.  Our machine controller is running XP, but I just upgraded to a new Windows 7 machine for development.  Under XP, I've been using the following incantation to create a file dialog:

Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
ObjFSO.Filter = "Text Documents|*.txt"
ObjFSO.FilterIndex = 1
ObjFSO.InitialDir = "c:\PCNC3\Nagahara\MeasureKeys"
InitFSO = ObjFSO.ShowOpen
If InitFSO = False Then
  Exit Sub
End If
PathName = ObjFSO.FileName


Apparently there are security issues with this approach and Microsoft has done away with it in Vista and Win7.  Searching the web, I found several different approaches that people have come up with to present a file dialog.  IMO the cleanest and most portable is here.  After installing this new dll on XP and Win7, the following code works under both operating systems to display a file dialog:

Set jsS = CreateObject("jsShell.Ops")
sFile = jsS.OpenDlg("Select file.", "txt", ""c:\PCNC3\Nagahara\MeasureKeys")


---
David

2
VB and the development of wizards / Re: array question
« on: December 12, 2010, 11:05:59 AM »
Arrays are type 12

a = Array(1,2)
b = Array(3,4)
c = Array(a,b)
MsgBox(VarType(a))         'returns 12
MsgBox(VarType(a(0)))     'returns 2
MsgBox(VarType(c))         'returns 12
MsgBox(VarType(c(0)))     'returns 8204

At
http://www.chennaiiq.com/developers/reference/visual_basic/functions/vartype.asp
I discovered 8204 is an array of variants

According to information found other places using the search "vartype 8204", to It should be possible to do either:
     MsgBox(c(0)(0) )
or
    ar=c(0)
    MsgBox(ar(0))
to get the the first element of the array a.

Guess this is a bug in the version of Cypress Enable that Mach uses.




3
VB and the development of wizards / Re: array question
« on: December 10, 2010, 09:44:20 PM »
Thanks for the reply, but it isn't what I want to do.   I want to create an array of references to arrays.

Using my example, here's what I want to do.

a = Array(11, 12, 13)
b = Array(14, 15, 16)
ar = a              'this works in Mach VB, ar is a reference to the array a
MsgBox(ar(1))   'this works in Mach VB, prints 12
c = Array(a, b)  'this compiles in Mach, VB, presumably c contains references to the arrays a and b
d = c(1)           ' this doesn't work, if it did, d would contain a reference to the array b
MsgBox(d(1))    'and it would print 15

The intriguing thing about all of this is IsArray(c(1)) returns true, but I can't figure out a syntax for getting at the elements of the array at c(1).



4
VB and the development of wizards / array question
« on: December 10, 2010, 01:35:26 PM »
Is there are way of expressing the assignment "d = c(1)" that works in VB?

"d = a" works and MsgBox(d(0)) returns 11.

a = Array(11, 12, 13)
b = Array(14, 15, 16)
c = Array(a, b)
MsgBox(IsArray(c))  'True
d = c(1)             'Error on line:5 - Type mismatch

Thanks in advance.

5
Machscreen Screen Designer / Re: Drag select and positioning
« on: June 04, 2009, 08:31:57 PM »
Awesome.  Thanks, Klaus.

6
Machscreen Screen Designer / Re: Drag select and positioning
« on: June 03, 2009, 09:17:59 AM »
I am using V1.20.0

A label must be selected and then moved via the keyboard arrows.  Dragging with the mouse does enable Save.

It would be handy if there was some way to control the number of pixels an object is moved via the keyboard.  Perhaps,
normal-arrow one pixel, shift-arrow 2 pixels, ctrl-arrow 5 pixels, etc.

7
Machscreen Screen Designer / Drag select and positioning
« on: May 28, 2009, 10:58:07 AM »
Hi,

I've been using machscreen and am  overall very happy with it.

However, I noticed that if a screen has a locked background, drag select doesn't work.

Many editing operations can be lost because the save options is not enabled.  For example, open a screen and move a label or led.  The program does not think any changes have been made.  Even worse, the "save" command is disabled so it is impossible to force save the file.  In my opinion, save should never be disabled.

Also, it would be really handy:

1) If after typing a position into the properties dialog, the <Enter> key performed the same function as clicking on the "Position" button.
2) If multiple objects could be selected and positioned or resized through the properties dialog.

David

8
Flash Screens / Re: Can't get Mach Nation to work
« on: April 15, 2009, 09:43:11 AM »
Ah.  I had to get an old flash plugin.  The "sticky" post at the top of this forum points to the current flash plugin (version 10) which did not work for me.

Here's where to get archived versions of old flash plugins:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14266&sliceId=2

I uninstalled all of the flash stuff (Version 10 plugin, CS3, etc.) and ran the standalone Adobe flash uninstaller on my "Mach" machine.

After installing flash from the 9r124 folder in the downloaded archive, Mach Nation works.   Whew.

9
Flash Screens / Re: Can't get Mach Nation to work
« on: April 14, 2009, 02:48:49 PM »
The latest Flash plugin is installed.

I installed "Flash CS3 Professsional" on the machine and the problem went away.  Now "Mach Nation" works fine.

10
Flash Screens / Re: Can't get Mach Nation to work
« on: April 14, 2009, 12:31:12 PM »
The Arial font is available.  I can access it in WordPad.

If you look at the screen capture jpg in my first post, the text "Tool:0" appears to be Arial.

The Mach Nation swf file looks and works fine when opened via Firefox on the same system?  When opened in Firefox the "change screen" buttons work, but in Mach, they don't.


Pages: 1 2 »