Sign in to follow this  
PcRobotic

Active report output a pop up message

Recommended Posts

Hello forum,
   I am thinking of making the ACTIVE REPORT pop up a message as if I wanted to.  Is that doable and what is the hard codes of which where I can start?

 

Like... If TOOL OVER ALL LENGTH < DEPTH then
             txtPopUpMessageA.visible  = true
           End if


ps: I am using VIRTUAL BASIC language (VB.net) to write the statement.

Thank you for the help.

Share this post


Link to post
Share on other sites

for vb.net use the messagebox function. example :

MessageBox.Show("message")

 

Share this post


Link to post
Share on other sites
1 hour ago, peter ~ said:

for vb.net use the messagebox function. example :

MessageBox.Show("message")

 

 

Hello Peter,
   I just typed exact as you suggested but it is not defined.  Is there some prior steps that I need to do?


Thanks.

Untitled.png.59cb00119557177c73f129981f44de15.png

Share this post


Link to post
Share on other sites

Its a reference to System.Windows.Forms are you able to add a reference to that assembly with your script compiler?

then add   using System.Windows.Forms at the top

Share this post


Link to post
Share on other sites
26 minutes ago, peter ~ said:

Its a reference to System.Windows.Forms are you able to add a reference to that assembly with your script compiler?

then add   using System.Windows.Forms at the top

This is what I have, I just want to make sure that I understand your instructions.

 

Thank you.

CODES.PNG.227eaaa4229f67104338049d9d9671dd.PNG

Share this post


Link to post
Share on other sites
30 minutes ago, PcRobotic said:

This is what I have, I just want to make sure that I understand your instructions.

 

Thank you.

CODES.PNG.227eaaa4229f67104338049d9d9671dd.PNG

Okay I will investigate further I am not very familiar with active reports, It is possible the Scripting language in use  doesn't observe the same "rules" as vb.net for applications. I will get back to you when I know more.

  • Thanks 1

Share this post


Link to post
Share on other sites
54 minutes ago, Werktuigbouwer said:

I believe you have not copied it correcly, try

MessageBox.Show("message")

Yes you are correct he did not copy correctly.

Share this post


Link to post
Share on other sites
2 hours ago, Werktuigbouwer said:

I believe you have not copied it correcly, try

MessageBox.Show("message")

 

Thank you for pointing it out but I think I still having issue with the "define".  Do you have any recommendations?

CODES.PNG.3bfc20b595bf30dcb15458d2b9d3ce0a.PNG

Share this post


Link to post
Share on other sites
1 hour ago, PcRobotic said:

 

Thank you for pointing it out but I think I still having issue with the "define".  Do you have any recommendations?

CODES.PNG.3bfc20b595bf30dcb15458d2b9d3ce0a.PNG

Hi pcrobotic,

You need to add the reference to winforms in order to use the function MessageBox:

I don't normally use VB but I double checked the code you need to add above your function in order for it to work is

Imports System.Windows.Forms
'//then
Sub ActiveReport_ReportStart
MessageBox.Show("Message")
End Sub

I tested it the assembly for winforms is there so this will work, let me know if you have any more issues.

Share this post


Link to post
Share on other sites
23 hours ago, peter ~ said:

Hi pcrobotic,

You need to add the reference to winforms in order to use the function MessageBox:

I don't normally use VB but I double checked the code you need to add above your function in order for it to work is

Imports System.Windows.Forms
'//then
Sub ActiveReport_ReportStart
MessageBox.Show("Message")
End Sub

I tested it the assembly for winforms is there so this will work, let me know if you have any more issues.

Hello Peter,
   I got it, very nice.  I have another question.  Can I write a statement in this MESSAGE BOX? 

 

Like... 

 

if OVER ALL LENGTH < DEPTH (Z-DEPTH) then show message "STICK OUT LONGER"  

show value of Z-DEPTH in the message as well
show value of OVER ALL LENGTH in the message as well

Is that possible?  Like the one in the image of which I just made it up by hand

 

Untitled.png.e36d9944ef99565897c5deb57ab93a65.png

Share this post


Link to post
Share on other sites
3 hours ago, PcRobotic said:

Hello Peter,
   I got it, very nice.  I have another question.  Can I write a statement in this MESSAGE BOX? 

 

Like... 

 

if OVER ALL LENGTH < DEPTH (Z-DEPTH) then show message "STICK OUT LONGER"  

show value of Z-DEPTH in the message as well
show value of OVER ALL LENGTH in the message as well

Is that possible?  Like the one in the image of which I just made it up by hand

 

Untitled.png.e36d9944ef99565897c5deb57ab93a65.png

Yes it is possible, we would need the variable names for your overall length and z-depth. Then write your function something like the following example :

  Dim overall_length As Double
        overall_length = -0.5
        Dim zdepth As Double
        zdepth = -1.0
        If zdepth < overall_length Then
            MessageBox.Show("Tool Overall Length : " & overall_length & "  Z-Depth : " & zdepth)
        End If

 

Share this post


Link to post
Share on other sites
On 11/8/2019 at 7:33 PM, peter ~ said:

overall_length = -0.5

Why do I have to put  = -.5? or 

zdepth = -1.0

  Aren't these I am staying they are DEAD NUMBERS?

Share this post


Link to post
Share on other sites

No it is just an example. Your tool length will be positive and your z depth will be negative (usually). So you will need to account for that in your equation.

Share this post


Link to post
Share on other sites

Start by displaying your lowest z depth and tool length in a textbox using the format in the example.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, peter ~ said:

Start by displaying your lowest z depth and tool length in a textbox using the format in the example.

Oh, alright. I will let you know when I completed.  It would be an amazing thing and you are the one I can count for thankful help.

Share this post


Link to post
Share on other sites
On 11/7/2019 at 10:06 AM, peter ~ said:

for vb.net use the messagebox function. example :

MessageBox.Show("message")

 

 

Hello Peter,
   I partially succeed output a message box.  However, I would like it to make multiple text line in one message box with some conditions.  Would you please tell me what I've done wrong?  

 

 

Thank you for your valuable help,
   S.Luong

=====================================
This is my hard codes but not succeeded.
1945613889_HardCodes.PNG.292bd4ad6b8371816ec53a0602c7b9ce.PNG

 

Cut Numbers.....

915860209_CUTNUMBER.PNG.12f6b8b3b5f2dd38ebcf2ab17b9bb538.PNG



This is what I want...

COMBINED.thumb.png.4a4d2152ba8d2f083ea386fa08c06e5b.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us