PHOTO PATH NAME

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
segxy4manu
Posts: 37
Joined: August 31st, 2016, 5:51 pm

PHOTO PATH NAME

Post by segxy4manu »

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: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: PHOTO PATH NAME

Post by aaronw »

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: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: PHOTO PATH NAME

Post by Gregory Martin »

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));
Post Reply