Hi all,
My request for Cspro is, to add global procedural section, so it will have :
global_preproc_first
global_preproc_end
global_postproc_first
global_postproc_end
global_killfocus_first
global_killfocus_end
global_onfocus_first
global_onfocus_end
All script on global procedural section will be applied into all variables and section in the application, *_first will be executed before current procedural section, and *_end will be executed after current procedural section, for example:
global_preproc_first
script1-------
global_preproc_end
script2-------
PROC MYVAR
preproc
<-----------------script1 will be executed here
current-script
<-----------------script2 will be executed here
postproc
Thanks to develepor for developing CSpro.
Best,
-iip-
add global procedural section
Forum rules
New release: CSPro 8.0
New release: CSPro 8.0
-
- Posts: 1777
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: add global procedural section
This is an intriguing idea that I have not thought of before. What are some kinds of scripts that you would put in a preproc/postproc?
If implemented, perhaps these scripts could be implemented similar to the OnKey and OnStop functions, which are default functions that can be overridden.
If implemented, perhaps these scripts could be implemented similar to the OnKey and OnStop functions, which are default functions that can be overridden.
Re: add global procedural section
Hi Greg,
The scripts can be anything that treat our variable generally, right now I'm working with CSpro for CAPI method, using this global procedural I want to change the interface, so we can customize the whole screen using external application, so maybe we can also use it for CASI (self interview) because the screen are looks now better to users.
The scripts can be anything that treat our variable generally, right now I'm working with CSpro for CAPI method, using this global procedural I want to change the interface, so we can customize the whole screen using external application, so maybe we can also use it for CASI (self interview) because the screen are looks now better to users.
-
- Posts: 1777
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: add global procedural section
One thing you might be interested in is an undocumented function in CSPro that you can override like OnKey and OnStop. On_Focus gets called after the OnFocus of each field on your form, so you can put some global stuff there. This means that the order of execution of a field is:
Field PreProc
Field OnFocus
Global Function On_Focus()
...
Field KillFocus
Field PostProc
Re: add global procedural section
ahh..thanks Greg, that is usefull information for me, I will try it soon, I think it will be usefull for my CAPI.
-iip-
-iip-
Gregory Martin wrote:One thing you might be interested in is an undocumented function in CSPro that you can override like OnKey and OnStop. On_Focus gets called after the OnFocus of each field on your form, so you can put some global stuff there. This means that the order of execution of a field is:
Field PreProc
Field OnFocus
Global Function On_Focus()
...
Field KillFocus
Field PostProc
Re: add global procedural section
Thank you for this forum, it's very helpfull.
I have used Global Function On_focus() in a CAPI application with CSPro 5 (the last Beta version). this is my syntax:
PROC GLOBAL
set explicit
alpha(256) qlabel;
function on_focus();
qlabel = getlabel();
end;
For the the first field I had the correct label. For the others, I had the label of the previous field.
Where is the problem?
Is it possible to have documentation about Crosstab, I want to learn more about producing tables with CSBatch ?
I have used Global Function On_focus() in a CAPI application with CSPro 5 (the last Beta version). this is my syntax:
PROC GLOBAL
set explicit
alpha(256) qlabel;
function on_focus();
qlabel = getlabel();
end;
For the the first field I had the correct label. For the others, I had the label of the previous field.
Where is the problem?
Is it possible to have documentation about Crosstab, I want to learn more about producing tables with CSBatch ?
-
- Posts: 1777
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: add global procedural section
I created a test application and on my testing, both getlabel and getsymbol return the correct values. Can you send me an application where they don't: gregory.martin@census.gov
The Census Bureau doesn't promote using batch mode to create tables. We suggest that most users use the interface. From the interface, you can press Control+L to view the logic that is being generated to create the tables.
One reason we don't promote batch mode is that there is scarce documentation about the syntax. However, ICFI Macro does use that mode, so you might consider contacting either of these guys:
http://www.linkedin.com/pub/guillermo-rojas/2a/649/979
http://www.linkedin.com/pub/trevor-croft/11/a4/796
The Census Bureau doesn't promote using batch mode to create tables. We suggest that most users use the interface. From the interface, you can press Control+L to view the logic that is being generated to create the tables.
One reason we don't promote batch mode is that there is scarce documentation about the syntax. However, ICFI Macro does use that mode, so you might consider contacting either of these guys:
http://www.linkedin.com/pub/guillermo-rojas/2a/649/979
http://www.linkedin.com/pub/trevor-croft/11/a4/796
Last bumped by Anonymous on July 12th, 2012, 7:08 pm.