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:

Saving input from a post question....


Recommended Posts

This is something that I know can be done, Dave Thomson shared it with me once years ago, of course I can't find it now.

Can I get some help on how to save the input from a post question and save it as a text file?

Creating the questions isn't a problem, it's keeping that data so that if I have to post again, that data is saved and populates the dialog boxes.

 

Link to comment
Share on other sites

I suppose you could read/write the value to/from a text file, something like the below;


return     : 0
my_setting : 0

fs2 4  1 0 1 0

fmt  "" 4  my_setting

fbuf 1 1 1 1 0

fq 1 my_setting "Enter a number"

p_load_question_defaults
    spathaux$ = smc_user_dir$
    snameaux$ = "questionDefaults"
    sextaux$ = ".txt"

    sbufname1$ = spathaux$ + snameaux$ + sextaux$

    if not(fexist(sbufname1$)),
        [
        auxprg$ = 1
        subout$ = 2
        newaux$
        *my_setting, e$
        return = fclose(sbufname1$)
        subout$ = 0
        ]
    else,
        [
        my_setting = rbuf(1,1)
        ]

p_save_question_defaults
    my_setting = wbuf(1,1)

pheader$
    p_load_question_defaults
    "Default value read from file :", *my_setting, e$
    q1
    "Value entered in prompt :", *my_setting, e$
    p_save_question_defaults

 

 

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...