|
On Sun, 2 Sep 2001, john smith wrote: > very far from perfect though. The biggest hurdle, > which I have not solved yet, is the handling of > displaying digits (grin) , there's no SQL in-built > function that could convert it to a string but with > the appropriate editing (double grin!). e,g if I pass > as a parameter 'select invnum || digits(amount) || > custno from FILE into YLINE', I can get something like > 'INV1234 000120900 CUSTOMERX' as output instead of a > prettier 'INV1234 1209.00 CUSTOMERX' > (If anyone knows how to circumvent this...) This is precisely why multidimensional arrays are needed. The sql select can return the data into a multidimensional array which is ALLOC'd by the api. Now you have an array of strings containing your values. So the first record returned is row[0] where row[0] is a string. row[1] contains a string with the next field in it. Then editing numbers is no problem. Since all results are strings you would have to convert numeric results to a numeric data type, but that is easy: eval number=atoi(string). You could use the BIFs then to %editc() your result or whatever else you wanted. Dynamic select statements become a breeze because the size and number of the result does not need to be known. A second topic here is how to make the screen dynamically change its layout based on the results. I even have a need for this now. I have set up 'preferences' files that contain user-customizable parameters for our applications. Not every application has the same kind of customizable components so it doesn't make sense to put it all in one file or on one screen. But I would like a program (ONE program) that can take any preference file and display the contents, allowing the user to change them. Not every file has the same number of preferences or the same type, so I want a program that can layout the screen nicely and only show those preferences that exist for a given file. I suspect that to do this I'm going to have to write the 5250 stream myself. Any ideas? James Rich james@eaerich.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.