hi again
i have an imported data stream (ascii) and need to check the first record to see if it contains a valid date. should be easy but there can be records that have month 13 (this is a flag for a special record). i need to ensure that the first two characters are between "01 and "13", then the next character has to be a slash "/". when i check for the slash it always fails the condition. i places a ui_msg_box there (the one with "second",var->test_char as an output) and when the code runs i get the ui_msg_box with the text "second" followed by a slash ("/") indicating two things to me:
1). the third character in the table isn't a slash due to the
if SUBSTR(tbl1.field_1,2,1)!="/" causes the message "second" to display
2). the third character in the table is a slash due to the output in ui_msg_box.
tbl1.index_primary_put()
tbl1.fetch_first()
if .not.between(SUBSTR(tbl1.field_1,1,2),"01","13")
ui_msg_box("first","")
goto fix_date
end if
if SUBSTR(tbl1.field_1,2,1)!="/"
test_char=SUBSTR(tbl1.field_1,3,1)
ui_msg_box("second",var->test_char)
goto fix_date
end if
if .not.between(SUBSTR(tbl1.field_1,4,2),"01","31")
ui_msg_box("third","")
fix_date:
as usual any help is appreciated form the kind souls here!!
regards,
ed
i have an imported data stream (ascii) and need to check the first record to see if it contains a valid date. should be easy but there can be records that have month 13 (this is a flag for a special record). i need to ensure that the first two characters are between "01 and "13", then the next character has to be a slash "/". when i check for the slash it always fails the condition. i places a ui_msg_box there (the one with "second",var->test_char as an output) and when the code runs i get the ui_msg_box with the text "second" followed by a slash ("/") indicating two things to me:
1). the third character in the table isn't a slash due to the
if SUBSTR(tbl1.field_1,2,1)!="/" causes the message "second" to display
2). the third character in the table is a slash due to the output in ui_msg_box.
tbl1.index_primary_put()
tbl1.fetch_first()
if .not.between(SUBSTR(tbl1.field_1,1,2),"01","13")
ui_msg_box("first","")
goto fix_date
end if
if SUBSTR(tbl1.field_1,2,1)!="/"
test_char=SUBSTR(tbl1.field_1,3,1)
ui_msg_box("second",var->test_char)
goto fix_date
end if
if .not.between(SUBSTR(tbl1.field_1,4,2),"01","31")
ui_msg_box("third","")
fix_date:
as usual any help is appreciated form the kind souls here!!
regards,
ed
Comment