PDA

View Full Version : Surprised to find how much the 'indicate' command appears in our codebase



DaveR
14-Jan-2019, 05:52 PM
... and 19.1 does not like it.

is the following a valid construct?

move (file1.field2 = variable2) to found

Tried it without problems but it just looks wrong

Richard Hogg
14-Jan-2019, 06:40 PM
I guess if it works it works but if you were pedantic the help says about Found "To indicate the success or failure of the last find."
I think a more correct way for your example might be:

String sTaste
Boolean bDrinkIt

Move "Good" to sTaste
...try and find a record in file1 table
If (Found) Move (file1.beer = sTaste) to bDrinkIt

But then that looks like a lot of code, maybe too verbose? Might need to have a beer and think about it some more :)

chuckatkinson
14-Jan-2019, 08:08 PM
Or
Move (Found and (File.Field2 = variable2)) to bFound

I use that all the time.

Mike Peat
15-Jan-2019, 08:33 AM
See https://www.reddit.com/r/funny/comments/4x28gw/this_is_why_code_reviews_are_a_good_thing/

starzen
15-Jan-2019, 09:31 AM
See https://www.reddit.com/r/funny/comments/4x28gw/this_is_why_code_reviews_are_a_good_thing/

of course not funny for a DataFlex programmer ;-)

DaveR
15-Jan-2019, 10:23 AM
See https://www.reddit.com/r/funny/comments/4x28gw/this_is_why_code_reviews_are_a_good_thing/

:D

DaveR
15-Jan-2019, 10:30 AM
LOL. Good example of a bad example.

'found' should have been some other boolean, but I was lazy and just pasted and trimmed off the rest.

Question arose because the most common use of indicate in the codebase is something like


find eq file by index.1
[ found] indicate found as file.field eq value
[ found] indicate found as file.field2 eq value2
[ found] indicate found as file.field3 eq value3
[ found] begin
...

end



obviously the report macro impressed my early developers