PHOTO PATH NAME

Discussions about creating CAPI applications to run on Android devices
segxy4manu
Posts: 7
Joined: August 31st, 2016, 5:51 pm

PHOTO PATH NAME

Postby segxy4manu » February 13th, 2018, 4:30 am

How can i set my Photopath name to name instead of stings like:-

Preproc
onfocus
//if PHOTO = 1 then
// Take photo
string photoFilename = maketext("%sphoto%d%s%d.jpg",
pathname(Application),STATE, LGA, EA_NAME);
//execsystem(maketext("camera:%s", photoFilename));}

Postproc
if PHOTO = 1 then
// Take/retake photo
execsystem(maketext("camera:%s", photoFilename));
endif;

the path underline is pre-coded but i want it to bring the actual state name, LGA name and EA Name as the photo name to be saved.

thanks

aaronw
Posts: 104
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: PHOTO PATH NAME

Postby aaronw » February 14th, 2018, 10:40 am

You will need to create an external lookup file for state, LGA, and EA. I'll use state as an example.

In the US your state lookup file would be structured like:

Code: Select all

STATE_ID STATE_NAME
01       Alabama
02       Alaska
03       Arizona


Then you would use loadcase and the STATE_ID to look up the STATE_NAME.
loadcase(STATELOOKUP_DICT, STATE_ID);
string photoFilename = maketext("%sphoto%s.jpg", pathname(Application),STATE_NAME);

Gregory Martin
Posts: 1094
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: PHOTO PATH NAME

Postby Gregory Martin » February 26th, 2018, 2:41 pm

Aaron's response is current in the case when you don't have a single value set that contains the full set of values for an item. However, if the STATE value set contained the full set of state names, you could simplify the code as:

string photoFilename = maketext("%sphoto%s.jpg", pathname(Application), getlabel(STATE,STATE));


Return to “Android”