Thread Reportgenerator-Problem: Formatierung mit dem Reportgenerator (32 answers)
Opened by michael25 at 2005-11-11 13:55

GwenDragon
 2005-11-12 11:31
#59985 #59985
User since
2005-01-17
14760 Artikel
Admin1
[Homepage]
user image
@michael25
Hattest du es so gemeint?
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Beispiel-Code
my $x = "v1\nv2\nv3\n";

my %vars;
my $varstring = '';

foreach ( split( /\n/, $x ) ) {
   $vars{$_} = $_;
   $varstring .= '$vars{' . $_ . '},';
}
chop($varstring); # letztes Komma entfernen


my $FORMATSTRING = "format OUTPUT = \n" .
                    ('@' . '<' x $maxLen . " ") x $values .
                   "\n" .
                   $varstring .
                   "\n.\n";
            
eval($FORMATSTRING);


//EDIT: Vertipper chomp -> chop geändert!\n\n

<!--EDIT|GwenDragon|1131789402-->

View full thread Reportgenerator-Problem: Formatierung mit dem Reportgenerator