Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

Field Validation in WiseScript Editor

Created: 05 Dec 2012 | 9 comments

Hi,

Using Wise Editor 8 I have myself a dialog box looking like this...
Each text field has a variable associated with it, the field that is called 'Main Database' has a variable called  -MAIN-
The Install button has a variable called 'INSTALL' and the value is 1

When I click the INSTALL button with nothing in the field called "Main Database" then I get this...

 

This is what I want to happen so all good so far. Within the properties of my INSTALL button, I selected the option that said 'Execute Named Event' and called it CHECK.

In the Dialog Script Editor for this, I have used the following code which is doing the job.

If DLG_EVENT_TYPE Equals "CHECK" then
  If -MAIN- Equals "" then
    Display Message "TEST"
  End
End

The problem I am having is when that field has been populated, then the INSTALL button seems to do nothing. It validates that the variable -MAIN- is not blank and no message displays but I also need it to 'Return to Script' as well. How do you do this!

I did try changing the above script to work against the variable called INSTALL associated with the Install button so it read...

If INSTALL Equals "1" then
  If -MAIN- Equals "" then
    Display Message "TEST"
  End
End

But that doesn't even display the message box and the Install button still lets me click with nothing happening.

Thanks for helping (yet again)

Paul

Discussion Filed Under:

Comments 9 CommentsJump to latest comment

EdT's picture

Have you tried single stepping through the code and watching the variables and how their values change?

This type of problem is diffuclt to solve without seeing the actual code you are using.

You should also verify that any variables you are using in your code are not using reserved variable names, and are not already declared as Compiler Variables.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Paul1977's picture

I've temporarily got around the problem for the time being by using a 'Set Control' method so,

Enable Control INSTALL

If -MAIN- Equals "" then
Disable Control INSTALL
End

If -PMI- Equals "" then
Disable Control INSTALL
End

etc....

But if anyone knows how to do it the way described in my first post, please let us know.
Perhaps there's a way of setting the 'Return to Script' action on the button in script? or an alternative way completly, not sure...

Thanks,
Paul

Paul1977's picture

Yeh I created a Display Message with the variables on EdT and made sure they were as expected, they are as expected. I'll check to see if these variables are used elsewhere, they may well be although the values at the time the script run are what I would expect them to be.

I can attach the whole program if you would like to have a look through it. Other than that, I can live with the way it works now. It's just nice to know why or what's wrong really.

EdT's picture

One further thing to check which sometimes catches people out, is the "If x = y" test, as the test is case sensitive unless you specifically select the "Ignore Case" options in your comparison logic.

Out of interest, the version of Wise Installation System you are using, which you mention is V8 - is that the version that comes in WPS 8, or the ancient WIS 8 from the 1990's ?

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Paul1977's picture

It'll be the version that comes as part of WPS 8.

I was looking around on Dragon Soft Libary, under the Scripts\Smaples section and came across something that almost does exactly what I want here, the only exception is that it doesn't work with a blank/NULL text field.

It's called "Pop Dlg" and works by calling the User32.dll and then sending somekind of PostMessageA to a push button if the condition of another field is met. I had some troubles understanding exactly how it worked, tried everything to get it working with a blank field but just couldn't crack it.

Paul

EdT's picture

The Dragonsoft library goes back many years to the time when Wise Installation Solution was a standalone product - essentially the late 1990's.  There are many examples that rely on API calls, but of course these used the API structures that were standard for Windows NT4, and it is likely that the API calls have changed in some ways since then. In addition, the increasing use of security in the operating systems means that some API calls will need to be elevated in order to run. Finally, Wisescript is a 32 bit process and therefore cannot handle interaction with 64 bit resources.

Wisescript remains a very useful tool, but it does have limitations on modern operating systems. So if you have found a solution to your problem, go with it!

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Paul1977's picture

Ok that's great, thanks for the information on this, I will stick with what I have for the time being.
Looking forward to trying out Admin Studio, that'll be the next thing to learn and read up on.

Thanks again.

Paul

EdT's picture

Flexera are supposed to be getting the source code for Wisescript from Symantec so that it can be included in a future release of AdminStudio. Although the WPS 8 MR1 release contains an updated version of Wisescript with some 64 bit capabilities, unfortunately the testing of this release was not as complete as it could have been and there are a few bugs that have resurfaced. Hopefully the Flexera programmers will spend some time getting all those old bugs out of the product and maybe even rebuild the whole program so that it is a true 64 bit product. Wishful thinking ....

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Mistral's picture

It is already there (since august) ... and it is not integrated ... and questions if it ever will be are not answered at all.

Thinkful wishing ...

http://community.flexerasoftware.com/showthread.ph...

http://kb.flexerasoftware.com/selfservice/microsit...