Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Post help please!!!!


Recommended Posts

Good morning guys,

I would like to set up my post to include " programmer ID number in the pheader"

For example

1= Steve

2= Henry

.......

......

 

So when he/she wants to post a program , they have to answer a prompt question such as:"ID number Please"

 

Thanks in advance

Link to comment
Share on other sites
Prompt the user for

information during posting

 

First, declare a user prompt function to display a prompt on the Mastercam screen.

In the Definition section of your post, enter a user prompt function.

For example:

fq 1 omitseq$ Enter 1 to omit sequences, 0 to use sequences

Then, call the question by inserting q with the fq definition number

(for example,q1) on a separate postline in the postblock where you want to prompt the user. pq

would be a logical postblock for this user prompt function call.

 

This is straight from the MP Post documentation. Give it a shot.

Link to comment
Share on other sites

Define the question and a string variable in the start of file

 

fq 1 programmer "ID Number"
sprogrammer    :  ""

 

Place q1 in the pheader section

 

sopen_prn, *progno$, " REV. N/C", sclose_prn, e$
     #sopen_prn, "PROGRAM NAME - ", sprogname$, sclose_prn, e$
     #sopen_prn, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52
     #sopen_prn, "DATE - ", month$, "-", day$, "-", year$, sclose_prn, e$  #Date output as month,day,year - Ex. 02-12-05
     #sopen_prn, "DATE - ", *smonth, " ", day$, " ", *year2, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005
     #sopen_prn, "TIME - ", time$, sclose_prn, e$  #24 hour time output - Ex. 15:52
     #sopen_prn, "TIME - ", ptime sclose_prn, e$  #12 hour time output 3:52 PM
     soprev = sblank
     q1
     if programmer = 1, sprogrammer = Tom
     if programmer = 2, sprogrammer = Dick
     if programmer = 3, sprogrammer = Harry
     sopen_prn, "Programmed By", sprogrammer, sclose_prn, e$

Link to comment
Share on other sites

You'd have to create error message, there should be an error message section i the post for that

add something like this

 

snoprogid "NO PROGRAMMER ID ENTERED, EXITING POST"

 

 

Then in the pheader section,

 

if programmer = 1, sprogrammer = Tom

if programmer = 2, sprogrammer = Dick

if programmer = 3, sprogrammer = Harry

if programmer < 1 | programmer > 3, result = mprint(snoprogid,1), exitpost$

 

That should work

Link to comment
Share on other sites

What you can do also is create a while condition in the pheader section that would keep asking the question as long as they don't enter a valid answer.

something like this:

while (programmer < 1 | programmer > 3),  #while the answer to the question is smaller than 1 or bigger than 3 it repeats the questions
 [
 q1
 ]

 

HTH

Link to comment
Share on other sites

:rolleyes:

lic : 0
:
:
:
licenca 
     if sim_no$ = xxxxxx, lic = 1, s_user = "Steve", e$
     if sim_no$ = xxxxx, lic = 1, s_user = "Henry", e$
     if sim_no$ = xxxxxx, lic = 1, s_user = "John", e$
:
:
if lic = 0 , exitpost$, e$


pheader$         #Call before start of file 
     licenca
     sopen_prn, "Programer: ", s_user, sclose_prn, e$  #File Descriptor

:D

Link to comment
Share on other sites

What's interesting with the numerical question prompts is that the default value showed into the prompt is the value the variable has been assigned to:

So if you have 3 programmers working off their local computer, you can put the programmer variable initialized to the number 1, 2 or 3 and have it set localy for each user. This way when the question comes up, they would just need to press enter to confirm, but they still would be able to change on the spot the value if they are not currently working on their own computer.


programmer : 1   #1=John,  2= Henry,  3=Mark

 

HTH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • 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

×
×
  • Create New...