Get Error Msg Number

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Get Error Msg Number

Post by khurshid.arshad »

Dear CSPro Team

Can i use Error Msg Number. For instance

When we synchronize the file from the server and file does not exist then this message popup.
100110 Error downloading file "%s": Check that the file exists on the server, that the path is correct and that you have permission to read the file.
I want to use errmsg(100100) in my programming.

Thanks.
a.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Get Error Msg Number

Post by Gregory Martin »

Those system messages are loaded into a different set of messages than the ones you can access in logic, so there's no direct way to display them.

You could copy the file "C:\Program Files (x86)\CSPro 7.5\CSProRuntime.en.mgf" to your application folder, rename it (so it doesn't start with CSProRuntime), and then attach it to your application as an external message file. If you do this, you can use the system error messages.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Get Error Msg Number

Post by khurshid.arshad »

Dear Gregory;

I have copied "C:\Program Files (x86)\CSPro 7.5\CSProRuntime.en.mgf" in my application folder and rename as CSPro.en.mgf and add this file in my applicaiton.

File->Add File->External Message File


Now I want to use CSPro.en.mgf file in my application.

When I run my application in the tablet the messages come from "CSProRuntime.en.mgf" instead of CSPro.en.mgf

Actually I want to rephrase some error messages to hide the information from the enumerator.

Like recording error messages.

Please advice.
Thanks.
a.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Get Error Msg Number

Post by Gregory Martin »

The file must be named CSProRuntime[...], otherwise it is treated as a file of user messages. You can keep the .en.mgf, or you could do something like CPSroRuntime.overrides.mgf. It's up to you, as long as CSProRuntime is at the beginning of the filename.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Get Error Msg Number

Post by khurshid.arshad »

Dear Gregory;

Thank you. It is working on my laoptop but not on the Tablet.

I have copied and rename as CSProRuntime.overrides.mgf in my Login and Menu folder and add in the application.

Save Login and Menu application as .pen file and then deployed.

a.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Get Error Msg Number

Post by khurshid.arshad »

Dear CSPro Team

Any update on this issue.

Thanks.
a.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Get Error Msg Number

Post by khurshid.arshad »

Dear Team;

Please find attached a test app. In the app i am using external Error Message file "CSProRuntime.overrides".

It is not working on tablet. However, on desktop is fine.

I have made some changes in Error Message Number 88889, 89254 and 89255.

I am using Desktop CSPro Version is 7.5.0 and Android CSPro version is 7.5.1 and Android Version is 5.1.1.

Best regards.
a.
Attachments
Test.rar
(53.18 KiB) Downloaded 161 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Get Error Msg Number

Post by Gregory Martin »

Thanks for bringing this to our attention, Arshad. You're right that this is a bug in 7.5. I believe that this would have worked in 7.4. I've fixed the problem for 7.6.

If you absolutely need this fix before we release 7.6 (in a few months), then please email cspro@lists.census.gov so Savy will see this and consider putting out a 7.5 patch release.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Get Error Msg Number

Post by khurshid.arshad »

Dear Gregory

Thank you for the prompt reply.

I Actually want to hide the recording and synchronization information and that is why i am looking at my external message file.

Now i am going to tell you how i will go about doing this.

I am using Audio.Record function with Audio object record: Starts recording audio in the background to hide the information from the enumerator about the recording and save this audio in some other place not in the same application folder.

I want to use external message file because some times during the interview we can get a recording error and the enumerator can understand that a recording is going on in the background. So we want to replace all the recording and audio words with some other words.

This the way I am hiding the file type and synchronization path during the synchronization from the tablet to the server.

First, zip all the audio files and then copy another folder to synchronize the files. After synchronization delete the zip folder from the synchronization folder.


Best regards.
a.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Get Error Msg Number

Post by Gregory Martin »

Take a look at this function: https://www.csprousers.org/help/CSPro/o ... ction.html

Rather than modify the messages, if will be easier for you to add that function to your application and then suppress the messages that you don't want. For example, this will suppress the displaying of audio messages:
function OnSystemMessage(numeric message_number)

   
recode message_number -> OnSystemMessage;
           
100300:100305  -> false;
                          ->
true;
   
endrecode;

end;
Post Reply