Re: Checking datatype of CHAR variable in 4GL
Posted in 1998
What I don't like about this approach is that it is time consuming. Anytime you ask 4gl to wander through a string you're wasting time. Not a big deal when you're talking onsey-twosey, but when this is a core algorithm for thousands or millions of records/rows it can get quite expensive. Much better to call a 'c' routine in these cases. cheers j. batonnet@zeta.org.au (Bryan Tonnet) on 02/19/98 12:19:20 AM Please respond to batonnet@zeta.org.au (Bryan Tonnet) To: informix-list@iiug.org cc: (bcc: Jack Parker/Boston50/Epsilon) Subject: Re: Checking datatype of CHAR variable in 4GL In <01bd3cc9$c5705b90$59dbc2d0@tycnine> "j" <tycnine@flash.net> writes: >I agree with the guy who said you need to resort to C to check whether >the field is numeric or not. If you want some example 4gl and C code on >how to do this drop a line at tycnine@flash.net. I missed the start of this thread, but for 4GL what about FOR count_l = 1 TO LENGTH(char_var) IF char_var[count_l, count_l] < "0" OR char_var[count_l, count_l] > "9" THEN <not numeric> END IF END FOR >The catchall for case is "whenever else". >case myfield > when "A" > do this > whenever else > do that >end case ? Again, for 4GL, isn't it OTHERWISE, as in CASE WHEN thing do this OTHERWISE do that END CASE -- Bryan Tonnet batonnet@phase4.com.au