Sign in to follow this  
JParis

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.

 

Share this post


Link to post
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

 

 

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