Search found 32 matches

by billtubbs
Mon Jan 14, 2008 9:06 pm
Forum: Beginners
Topic: VBEval not working
Replies: 1
Views: 3944

Problem solved

I fixed it. I didn't realise you need to have VBStart/End commands before any VBEval commands. Would be nice if it said this in the VBEval help documentation, or if VBEval generated an error when this was not the case. Here is the working script: VBStart VBEnd VBEval>(1+2),three VBEval>MsgBox("Hello...
by billtubbs
Mon Jan 14, 2008 8:47 pm
Forum: Beginners
Topic: VBEval not working
Replies: 1
Views: 3944

VBEval not working

This must be so obvious I can't see it. For some reason the VBEval command is not working in my script. I tried three examples of VBEval commands from the Help Documentation. VBEval>(1+2),three VBEval>MsgBox("Hello World"),nul VBEval>Timer,elapsed Let>test=test message MessageModal>three=%three%, el...
by billtubbs
Sat Nov 17, 2007 4:59 pm
Forum: Technical / Scripting
Topic: Macro Scheduler stops processing
Replies: 9
Views: 10748

Is it possible you have multiple windows that match APL* ? No. APL* is the only window. The SetFocus command works in the sense that focus switches to the APL window. The problem is that at that instant all further macroscheduler commands stop until I manually respond to APL's user prompts. Basical...
by billtubbs
Sat Nov 17, 2007 12:35 am
Forum: Technical / Scripting
Topic: Macro Scheduler stops processing
Replies: 9
Views: 10748

Problems again!

A year later I am still having problems automating this APL application! However, now that I have diagnosed the problem properly, perhaps someone can help me. Diagnosis: Once the APL processor reaches the point where the user prompt appears in the window, the program has the potential to hang-up all...
by billtubbs
Wed Apr 18, 2007 8:15 pm
Forum: Technical / Scripting
Topic: Error trying to create dialog:
Replies: 5
Views: 7095

Thanks JRL
that does the trick.
Bill.
by billtubbs
Wed Apr 18, 2007 7:03 pm
Forum: Technical / Scripting
Topic: Error trying to create dialog:
Replies: 5
Views: 7095

Thanks, I figured that. It might be worth explaining this on the dialog reference page.

So does this mean all dialogs static? You can't have the same dialog show different label text and you can't pass variables to a dialog?
by billtubbs
Wed Apr 18, 2007 6:10 pm
Forum: Technical / Scripting
Topic: Error trying to create dialog:
Replies: 5
Views: 7095

Error trying to create dialog:

I am using a dialog box for the first time. The problem only occurs when I put the dialog definition within a loop. It executes fine the first time, the second time around the loop I get the following error message: "Error trying to create dialog: MyDialog" In the help on Dialogs there is nothing ab...
by billtubbs
Wed Apr 04, 2007 10:28 pm
Forum: Beginners
Topic: Using VB script FileSystemObjects
Replies: 1
Views: 4058

Sorry! stupid mistake.

I didn't notice that ForReading is a locally defined constant. The code should be:

Code: Select all

Const ForReading = 1
Dim fso, ts 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set ts = fso.OpenTextFile("C:\Program Files\CIMS\testfile.txt", ForReading) 
by billtubbs
Wed Apr 04, 2007 8:34 pm
Forum: Beginners
Topic: Using VB script FileSystemObjects
Replies: 1
Views: 4058

Using VB script FileSystemObjects

I'm trying to access text files in VB using the FileSystemObjects. Dim fso, ts Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile("C:\Program Files\CIMS\testfile.txt", ForReading) When I run this code I get the error message shown below. The line corresponds to the third ...
by billtubbs
Fri Mar 16, 2007 9:11 pm
Forum: Beginners
Topic: Deciding when to use VBscript and when to use MS script
Replies: 6
Views: 11267

Thanks, but your suggestion only shows how to pass constants (1,2,3). I want to pass an MS variable 'P1' to the VB script subroutine. For now I have converted the subroutine to a VB function and I am passing the variables as follows: VBEval>setx(%P1%,%P2%,%P3%,%PA%,%TEXP%),result This works, but sur...
by billtubbs
Fri Mar 16, 2007 7:08 pm
Forum: Beginners
Topic: Deciding when to use VBscript and when to use MS script
Replies: 6
Views: 11267

OK, so all my variables are now VB script global variables. That works. Now to change any of them from MS script I have made subroutines such as this one: Sub setx(P1_c, P2_c, P3_c, PA_c, TEXP_c) P1=P1_c P2=P2_c P3=P3_c PA=PA_c TEXP=TEXP_c MsgBox("P1 set to "&P1) End Sub Problem is I can't find a wa...
by billtubbs
Thu Mar 15, 2007 11:49 pm
Forum: Beginners
Topic: Deciding when to use VBscript and when to use MS script
Replies: 6
Views: 11267

Here's one tip I thought of myself already: If I declare Public variables for all variables commonly used in VB script then I can run an initialising sub-routine once at the beginning that passes all the values from Macro script. After this, only variables that change need to be passed to VB script ...
by billtubbs
Thu Mar 15, 2007 11:09 pm
Forum: Beginners
Topic: Deciding when to use VBscript and when to use MS script
Replies: 6
Views: 11267

Deciding when to use VBscript and when to use MS script

Hi I need to think through my strategy carefully for writing a macro that deals with quite a few variables and some fairly large matrices (2D). I will need to use VBscript functions but I want the overall control to remain in Macro scheduler script. I've done some research and I think I should use t...
by billtubbs
Thu Mar 15, 2007 10:44 pm
Forum: Beginners
Topic: How to check if variable contains a number
Replies: 2
Views: 5493

Testing if numeric - problem solved

Of course, do it in VBScript. Should have thought of that.
thanks
Bill.
by billtubbs
Thu Mar 15, 2007 9:25 pm
Forum: Beginners
Topic: How to check if variable contains a number
Replies: 2
Views: 5493

How to check if variable contains a number

Hi I am writing a macro that reads data from a text file using the Readln> command. Occasionally the text file will contain a line with only one number on it. When this happens the variable that is assigned the line of text becomes numeric and seems to have different properties. For example the foll...
Sign up to our newsletter for free automation tips, tricks & discounts