|
Hans can I ask you to explain this python code a little bit?
-------------------------------------------- # Set up the replacement variables title = 'This is the title' body = '<p>This is the body</p>'
# Write out the web page print template % vars() --------------------------------------------
What is "vars()"? a collection of all the variables in the current procedure?
-------------------------------------------- # Set up the replacement variables vars = {} vars['title'] = 'This is the title' vars['body'] = '<p>This is the body</p>'
# Write out the web page print template % vars --------------------------------------------
What is "%"? An argument seperator?
Is the "print" function able to retrieve the names of the variables and the values also?
If this is in the ballpark, can a programmer write a similar function that receives a collection of variables as a parm?
Does anything prevent python from running on the iSeries?
Thanks. Python looks like it is fun, but using procs, the current RPG could come close to your example like so: template = ReadSourceMemberIntoString( Srcf: SrcMbr ) ; AddToVarCollection( vars: 'Title': Title ) ; AddToVarCollection( vars: 'Body': Body ) ; ApplyVarsToTemplate( result, template, vars ) ; WriteToStdOut( result ) ;
And of course if RPG was open sourced, with IBM not losing any revenue because it stays a part of websphere, then RPG could be extended in experimental ways. And the marketplace would decide if the extension is worthwhile or not.
Steve Richter
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.