Pushbutton

14 posts / 0 new
Last post
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi William, you could do something like this to check the code.

If UCase(Mid(sImportDefinition, Len(sImportDefinition) - 3, 3)) <> "JPM" Then
	'it is not a jpm file
Else

End If

 

William Yong
Offline
Joined: 06/30/2014 - 00:37

Hi Brian,
I encounter error while input the code that you recommended. Please refer to 'error msg(2)' screen attached. What could have gone wrong here?
How am I able to allow user to go back to the menu screen to perform other task after the result is displayed? I put the Do..Loop While button > 0 inside the Function displayIt, but it seems not working here. Please assist. From the 'replace existing file' screen, how am I able to prevent user from seeing the same screen while perform/execute the same test in the menu? And lastly, from the 'idea files' screen, how am I able to display only the results from my last action, instead of displayed all the databases in the idea files window. And I noticed from the last selection of the aaaaaa2 files, the result/output is displayed in the aaaaaaa database. Any idea that I could make the results generated in the same database selected?
Thanks in advance.
Regards, William.
 

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi William for the syntax error the mid function does not seem to like having a variable as the second paramater.  I think I tried the original one on V9 and it works by V8 gives an error.  Can you try the following as this seems to work:

If UCase(Right(sImportDefintion, 3)) <> "JPM" Then

For your second question it is hard to answer without seeing your script, any chance you can send it to me at brian.element@ideascripting.com and I will have a look at it.

To display only what you want to can use the db.close at the end of each routine and delete the line that is usually added saying client.OpenDatabase(dbName).  You can also use the client.Closeall function and then only open the database that you want viewed.

To get rid of the Replace Existing File dialog you can do two things, when selecting a new database name you could use the following function:

dbName = client.UniqueFilename("Filename") 'make sure you don't include the .imd at the end

or you could delete the old file and then replace it with the new one.

I think I covered your questions, let me know if I missed something or if something doesn't make sense.

Pages