Re: Can We Do Sed-Style Regex in 4GL?
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Java & JDBC Development
Elisa Roselli wrote: > We have a problem with a program written in Informix 4gl for the purposes of > internationalising the error messages in the modules of our applications. > > What we want to do is a very straightforward text substitution throughout > the modules. Under Unix, using a system call to sed, we got the results we > wanted with a single line of code along the lines > s/regular_expression_to_be_substituted/substitution_string/ . But our > supervisor has just reminded us that we need to stay platform independent. > Should our development environment switch to Windows, system calls to Unix > from within our 4gl application modules could cause problems. > > Our young developer is heartbroken since this is a huge setback in terms of > delivery time. I'm asking on his behalf, and somewhat naively since I know > scarcely any 4gl, if there is any hidden or new function or add-on or > anything in Informix 4gl that allows for this kind of regular expression > substitution from within the language, without any external calls? > > Many thanks for your patience and advice, > > Elisa Roselli > Volume Software > France 4GL is not an editor, but a programing language. You can write a program which would do this for you in 4GL. However on NT there are other editors which may do the job for you, (word for example). It also depends on how often you which to replace these strings. If you wish to do it for each language then, you are better off putting the information on the database, or in some files and read them as variable in your program depending on the language. Finally once you have changed the strings as you have suggested the code can be transferred to any other machine and compiled, as the 4GL itself is platform independent. -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible, and Connection to other RDBMS such as Oracle. Hydra 4GL Compiler (Compatible with I4GL) Compile once, run everywhere Phoenix Windows GUI. (Front End to 4GL) Chimera Java GUI The only GUI you will ever need... (Front End to 4GL) Arachne Web Technology (Front End to 4GL on the Web) For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------
I haven't expressed myself clearly enough. We know that 4gl is a programming language not a text editor. We need to use this language to write a program that will automate the modification of other 4gl programs. We have an application with some 3 million lines of source code. All the text strings, such as menus, error messages, etc, have been hard-coded directly in the source. What we are working on now is a set of tools for extracting and identifying all these text elements and dynamically substituting them with versions in different languages according to user configuration. Certain tools such as sed, awk and perl are ideal for the kinds of string analysis that this large task entails. However, for reasons of coherence we are obliged to keep everything strictly within a 4gl development environment, so we are bereft of the comfort that sed, awk or perl can offer. Thanks for your kind reply. I'm sorry if I sounded even more out of it than I verily am. : ' ) Elisa Roselli
Elisa Roselli wrote: > I haven't expressed myself clearly enough. We know that 4gl is a programming > language not a text editor. We need to use this language to write a program > that will automate the modification of other 4gl programs. We have an > application with some 3 million lines of source code. All the text strings, > such as menus, error messages, etc, have been hard-coded directly in the > source. What we are working on now is a set of tools for extracting and > identifying all these text elements and dynamically substituting them with > versions in different languages according to user configuration. > > Certain tools such as sed, awk and perl are ideal for the kinds of string > analysis that this large task entails. However, for reasons of coherence we > are obliged to keep everything strictly within a 4gl development > environment, so we are bereft of the comfort that sed, awk or perl can > offer. > > Thanks for your kind reply. I'm sorry if I sounded even more out of it than > I verily am. : ° ) > > Elisa Roselli I am still at the opinion that if you replaced the menu items etc ... in your original 4GL with veriables, you can put the information on the database, and according to the language setting read the information into the respective veriables, it may take you slightly more time to start with, but then you have a one version product to support, one binary, no need to recompile for each language, no need to keep track of several languages, no need to use sed or any other program. It is simple and effective, and everything is kept in a 4GL development environment. -- Compliments of QueriX -------------------------------------------------------------------------------------------------- QueriX 4GL Compilers are Informix 4GL Compatible, and Connection to other RDBMS such as Oracle. Hydra 4GL Compiler (Compatible with I4GL) Compile once, run everywhere Phoenix Windows GUI. (Front End to 4GL) Chimera Java GUI The only GUI you will ever need... (Front End to 4GL) Arachne Web Technology (Front End to 4GL on the Web) For more details visit: http://www.querix.com/ ---------------------------------------------------------------------------------------------------
On Thu, 24 Feb 2000 17:13:31 +0100 Elisa Roselli wrote: > > Certain tools such as sed, awk and perl are ideal for the kinds of string > analysis that this large task entails. However, for reasons of coherence we > are obliged to keep everything strictly within a 4gl development > environment, so we are bereft of the comfort that sed, awk or perl can > offer. > Maybe you can build an extension library for 4GL using (say) PCRE (perl compatible regular expressions). Then you can use Regular expressions from within your 4GL program - I'll download PCRE onto my laptop and have a look at it myself ... However I think you have a management problem - you should be allowed to use whatever tools are best for the job. /J\\ -- Jonathan Stowe http://www.gellyfish.com http://www.tackleway.co.uk