CompuServe Thread

#State variable saved?

8 messages in this thread
#85847From: Martin EnthedFeb 23, 1994 9:14 AM
How do I get the state variable saved when finished an IPAS that uses the new type of user dialog. I have set the variables in there proper feel funktions but when reentering the IPAS program I still get the default values in the state variables, not the ones from the previous session? What have I forgotten?! -M.E
#85868From: Jonas Ruikis [ADESK]Feb 23, 1994 10:29 AM
Martin, << saving the state >> I forwarded your question to the team. jonas[adesk]
#85923From: Jonas Ruikis [ADESK]Feb 23, 1994 12:43 PM
Martin, << state variables.. >> There is no state variables when you use the new style dialog. See the doc or any examples with a new style dialog. If he wants to same them from session to session, he should make them global variables. I'm pretty sure this will work. /Jim ——————————————
#85937From: Jonas Ruikis [ADESK]Feb 23, 1994 1:37 PM
QA also responded with a reference to ClientGetStateVar and ClientSetStateVar for state variables.
#86119From: Martin EnthedFeb 24, 1994 2:56 AM
<<QA also responded with a reference to ClientGetStateVar and ClientSetStateVar for state variables.>> I know of these and have tried to set as IPAS R2 style, but these doesnt seam to be used in a PXP with new type of dialog!?
#86118From: Martin EnthedFeb 24, 1994 2:56 AM
<<There is no state variables when you use the new style dialog-Jim>>. They are used in the ORBIT_I.KXP sample C file and in that KXP they seem to be saved when exiting the function ClientDoCustomDialog(). If the "dlgResult"==1 its saved otherwice not. The thing is that I am making a PXP and there are no sample C files that saves there settings. I have made sure that i set the state variables myself in the dialog so they have the right settings when leaving the PXP, but they dont get saved anyway!! DLGTEST,EDTEST,GAMMA and INFO none of them do or should save there settings to the next session! I have included a part of the sourcecode from ORBIT_I.PXP that does save its settings!! —-End of ClientDoCustomDialog—-raw 394-406 of ORBIT.C ——— /* if the user cancelled, terminate. */ if( !dlgResult ) { return 0; } /* save the results from the dialog. */ state.frames = atoi( mainedit[0].string ); state.keys = atoi( mainedit[1].string ); state.tiltLR = slid[0].value; state.tiltFB = slid[1].value; return 1; } ——————————————— <<See the doc or any examples with a new style dialog.-Jim>> I'm doing that !!!!! <<If he wants to same them from session to session, he should make them global variables. I'm pretty sure this will work.-Jim>> How do I make global variables?
#86224From: Jonas Ruikis [ADESK]Feb 24, 1994 12:56 PM
<<QA also responded with a reference to ClientGetStateVar and | ClientSetStateVar for state variables.>> | | I know of these and have tried to set as IPAS R2 style, but these | doesnt seam to be used in a PXP with new type of dialog!? | | -M.E No they aren't used in a new type dialog. If you are using a new style dialog the following sequence occurs. This is for a PXP from start to finish. ClientGetState ClientResetState ClientUsesCustomDialog ClientDoCustomDialog ClientGetState ClientStartup ClientUserCode ClientTerminate greg
#86227From: Jonas Ruikis [ADESK]Feb 24, 1994 1:06 PM
Martin, Answered by QA: I was wrong about this. There are state variables, but they are used differently from the old style dialog. With the new style dialog, the values from the dialog have to be saved to the state struct. But I guess he knows about this from his section below. I use the old style dialog(less overhead and easier to follow) in my PXP's and everything from the previous session is always saved in the dialog. What I mean by global is global to his IPAS routine. Put them at the top of his routine. I think this will work. /Jim