In this article I will explain how I extract pragmatically the enumerations differences between Powerbuilder releases using EmbeddingPerl library and the differents pbperlxxx interpreters.
Just run each version of pbperlxxx interpreter from command line :
pbperl100 -MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.':'.$/.' ' . join $/.' ', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;" > enums100.txt pbperl105 -MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.':'.$/.' ' . join $/.' ', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;" > enums105.txt pbperl110 -MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.':'.$/.' ' . join $/.' ', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;" > enums110.txt pbperl115 -MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.':'.$/.' ' . join $/.' ', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;" > enums115.txt pbperl120 -MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.':'.$/.' ' . join $/.' ', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;" > enums120.txt pbperl125 -MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.':'.$/.' ' . join $/.' ', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;" > enums125.txt
Then I compare the results files using a diff tool to extract differences…
my @versions = qw( 100 105 110 115 120 125 ); sub compare{ my ($a, $b) = @_; print "Between $a and $b:\n"; my $code = '-MPowerbuilder=":all" -MPowerbuilder::EnumClasses -e "print join $/,map{ $_.\':\'.$/.\' \' . join $/.\' \', sort keys %{Powerbuilder::EnumClasses::GetItems($_)}} sort grep{/^[^\d].*/} keys %Powerbuilder::EnumClasses;"'; `pbperl${a} $code > tmp${a}.txt`; `pbperl${b} $code > tmp${b}.txt`; print join $/, map{s/^[<]/-/; s/^[>]/+/;$_} grep {/^[<>]/ && !/^[<>] CLASS/} split /\n/, `diff tmp${a}.txt tmp${b}.txt`; unlink "tmp${a}.txt"; unlink "tmp${b}.txt"; print "\n\n"; return 0; #don't mind
And the output was :
Between 100 and 105: + argcallingconvention: + byreferenceargument + byvalueargument + readonlyargument + varlistargument + datetimeformat: + dtfcustom + dtflongdate + dtfshortdate + dtftime + filetypedoc + filetypehtml + filetypepdf + menustyle: + contemporarymenu + traditionalmenu + datepicker + typebyte + typelonglong + toolbarstyle: + contemporarytoolbar + traditionaltoolbar + webpagingmethod: + callback + postback + xmlclientside Between 105 and 110: + dbnotification: + dbdatatruncate + dbfailover + dbnonotification + dbserverdown + mlsync + mlsynchronization + syncparm + ulsync + wsconnection + orientationtype: + paperlandscape + paperportrait + appstarting + help + hyperlink + nopointer + bmp + jpeg + png + tiff + syncprocesstype: + bidirectional + downloadonly + uploadonly + collapsed + collapsing + expanded + expanding + treenodeselected + treenodeselecting + wserror + windowanimationstyle: + bottomroll + bottomslide + centeranimation + fadeanimation + leftroll + leftslide + noanimation + rightroll + rightslide + toproll + topslide Between 110 and 115: + richtexttoolbaractivation: + richtexttoolbaractivationalways + richtexttoolbaractivationnever + richtexttoolbaractivationonedit + sqlfunction: + sqldbdelete + sqldbinsert + sqldbothers + sqldbprocedure + sqldbrpc + sqldbselect + sqldbupdate Between 115 and 120: + flowdirection: + lefttoright + righttoleft + xlsb + xlsx Between 120 and 125: