Page 1 of 1

PHOTO PATH NAME

Posted: February 13th, 2018, 4:30 am
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

Re: PHOTO PATH NAME

Posted: February 14th, 2018, 10:40 am
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);

Re: PHOTO PATH NAME

Posted: February 26th, 2018, 2:41 pm
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));