Search found 1775 matches

by Gregory Martin
May 4th, 2017, 7:53 am
Forum: Other
Topic: Unexpected ending CSBatch
Replies: 3
Views: 4370

Re: Unexpected ending CSBatch

That's interesting. If you can share your code, please send it to greg@csprousers.org and I can take a look at it. You don't have to send data.
by Gregory Martin
May 4th, 2017, 7:51 am
Forum: Entry
Topic: How to detect duplicates cases ?
Replies: 9
Views: 7458

Re: How to detect duplicates cases ?

If using 7.0 (which you have to for keylist), you can also use the find function on the input dictionary. Construct the potential key as a string, and then do something like this: if find (INPUT_DICT,=,keyString) then errmsg ( "You 've already entered a case with these IDs" ); endif ;
by Gregory Martin
April 30th, 2017, 10:52 am
Forum: Entry
Topic: Logging operator ID with cases entered
Replies: 10
Views: 9641

Re: Logging operator ID with cases entered

The getoperatorid function returns the operator ID text that was entered when the keyer/interviewer opened CSEntry. At the beginning of the case, you can fill in your variable: PROC QUEST preproc OPERATOR_ID = getoperatorid (); If you don't want that variable overwritten if program is opened by some...
by Gregory Martin
April 30th, 2017, 10:43 am
Forum: Entry
Topic: how to use the name of an item in a function
Replies: 3
Views: 3087

Re: how to use the name of an item in a function

Ahh, right! Good fix. I forgot that maxsize is the maximum value, not the width of the maximum value.
by Gregory Martin
April 29th, 2017, 11:37 am
Forum: Entry
Topic: how to use the name of an item in a function
Replies: 3
Views: 3087

Re: how to use the name of an item in a function

Only some CSPro functions, like getvalue, allow you to query the value of an item whose name is stored in a string variable. You can't do that with maxvalue. Your best option is to write this: function string edit1( string varname,maxsize) string formatter = maketext ( "%s0%dd" , '%' ,maxs...
by Gregory Martin
April 29th, 2017, 11:28 am
Forum: Tools
Topic: Export Data with command line
Replies: 1
Views: 2932

Re: Export Data with command line

Export applications have PFF files like other CSPro applications. In the Export Data tool, create your export specification and save the file (as an .exf file). When you run the export, you'll get a PFF. In the future, you can run just the PFF to do your export. From the command line you can write: ...
by Gregory Martin
April 29th, 2017, 11:26 am
Forum: Entry
Topic: Export with text data in Dari/arabic
Replies: 4
Views: 4303

Re: Export with text data in Dari/arabic

As Josh mentioned, CSPro 7.0 will be able to export Unicode data to Stata. It's implemented, so hopefully 7.0 will come out soon. When we added Unicode to CSPro, Stata didn't support Unicode, but they do now (as of version 14).
by Gregory Martin
April 27th, 2017, 7:23 pm
Forum: Entry
Topic: function who return the length of an numeric item from the dictionnary
Replies: 6
Views: 5453

Re: function who return the length of an numeric item from the dictionnary

That function doesn't exist in CSPro 6.3. In CSPro 7.0, which is now in beta, you can write:
keylist(DICT_NAME);
That will return the number of cases.
by Gregory Martin
April 27th, 2017, 9:10 am
Forum: Tools
Topic: Tools to Direct Change Duplicate ID Number
Replies: 6
Views: 12535

Re: Tools to Direct Change Duplicate ID Number

The problem is that your dictionary, PROJ_01.dcf, doesn't have a record type. The ID, RESP_ID, goes from position 1-6 in the file. In what I sent you, the record had a record type and so the ID went from position 2-7 in the file. If you change that, you can run your code and you get this output: ***...
by Gregory Martin
April 27th, 2017, 8:49 am
Forum: Entry
Topic: function who return the length of an numeric item from the dictionnary
Replies: 6
Views: 5453

Re: function who return the length of an numeric item from the dictionnary

If you don't have a value set, you can use the maxvalue function, which will return the highest value supported by the field. This should get you the length:
length(maketext("%d",maxvalue(ITEM_NAME)));