RE: [Arsperl-users] Field Labels
Brought to you by:
jeffmurphy
|
From: Richard H. <rl...@ls...> - 2005-08-03 12:22:11
|
Jerry,
Try using the function below. You'd call it as (e.g.):
my $external_label = get_field_label(
$ctrl,
$schema_name,
$fids{'Create Date'},
undef
);
If you want to pick the label from a certain VUI, then give the # of that
VUI in place of the "undef".
Any questions, please get back to me.
Cheers,
Richard.
-------------
sub get_field_label ($$$$) {
#
# Step 1) Grab the args
#
my ($ctrl, $schema, $fid, $vui) = @_;
#
# Step 2) Fetch the field structure
#
my $field_struct = ars_GetField(
$ctrl,
$schema,
$fid,
);
#
# Step 3) Now pick a VUI structure from the the list; If we were given
# the # of a VUI, look for that else just use the first in the
# list
#
my $vui_list =
$field_struct->{displayInstanceList}->{dInstanceList};
my $vui_index;
if (defined($vui)) {
for (my $i = 0; $i < @$vui_list; ++$i) {
if ($vui eq $vui_list->[$i]->{vui}) {
$vui_index = $i;
last;
}
}
} else {
$vui_index = 0;
}
#
# Step 4) Now look for property 20 in the properties list
# of the chosen VUI structure
#
my $result;
foreach my $p (@{$vui_list->[$vui_index]->{props}}) {
if ($p->{prop} eq 20) {
$result = $p->{value};
last;
}
}
#
# Step 5) ... and return whatever we found
#
return $result;
}
-----Original Message-----
From: ars...@ar...
[mailto:ars...@ar...] On Behalf Of Jerry Niman
Sent: 03 August 2005 10:55
To: ars...@ar...
Subject: [Arsperl-users] Field Labels
Does anyone have any sample code for determining the label used for a
particular field?
I can't get my head round the various structures involved!
Jerry
Jerry Niman Tel +44 (0)161-247 1474
Head of Information Systems Email J....@mm...
the Manchester Metropolitan University Mobile +44 (0)7770 638104
Before acting on this email or opening any attachments you should read the
Manchester Metropolitan University's email disclaimer available on its
website http://www.mmu.ac.uk/emaildisclaimer
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from
IBM. Find simple to follow Roadmaps, straightforward articles, informative
Webcasts and more! Get everything you need to get up to speed, fast.
http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Arsperl-users mailing list
Ars...@ar...
https://lists.sourceforge.net/lists/listinfo/arsperl-users
|