Gossamer Forum
Home : Products : DBMan : Customization :

Records equalling specific codes to display the value of the variable

Quote Reply
Records equalling specific codes to display the value of the variable
i have worked with dbman alot and really i have stumbled upon somethign that i have no idea how to do.

Here is what i want to do. I have a set of codes that have a value, example

$CODE1 = 'MY1VALUE';
$CODE2 = 'MY2VALUE';
$CODE3 = 'MY3VALUE';
$CODE4 = 'MY4VALUE';

i have these set in the cfg file with all the other variables.

then i want dbman to be able to match up values as needed. example (not actual code just the idea of it)

if $rec('CAR') eq $CODE1 then spit out the value of $CODE1. i got it to read the variables fromt he cfg file, but when i use this logical i got $CODE1 spit out on the view_success

any ideas? of a better way to have these value of the specific codes actually be converted when being spit out? without having the if command itself having the value.

many thanks,
Quote Reply
Re: [TKEP1008] Records equalling specific codes to display the value of the variable In reply to
This might work...

In your .cfg file, define your variables like

$Value{CODE1} = 'MY1VALUE';
$Value{CODE2} = 'MY2VALUE';
$Value{CODE3} = 'MY3VALUE';
$Value{CODE4} = 'MY4VALUE';

Use CODE1, CODE2, etc in the records.

When you print it out, use $Value{$rec{'CAR'}} to print out your value.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] Records equalling specific codes to display the value of the variable In reply to
thank you, this worked perfectly. its nice because i had 3000 lines of these variables and didnt want to make if commands for each type of data i wanted to use this for. thank you

Jose
Quote Reply
Re: [TKEP1008] Records equalling specific codes to display the value of the variable In reply to
I'm glad to help. Those associative arrays are really cool once you get a handle on them.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.