Jump to content


Photo
- - - - -

Coding bug


17 replies to this topic

#1 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 03 November 2006 - 02:17 PM

Just to share some of my own stupidity...

Did you know, if you put a DSELF in the DefLg of an LR, that it causes the entire file to be read? :)


I had a brain cramp, and had intended it to be an LSEXIT

#2 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 06 November 2006 - 05:52 PM

Are you sure it's the presence of a DSELF Rick, not just the absence of any SEL-xxx (ie. "normal behaviour") ?
Nothing's as simple as you think

#3 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 06 November 2006 - 06:36 PM

Am I "sure"? Not with 100% certainty. I haven't retested, but I don't remember having DSELF EXIT, which in theory means that it should have executed the SEL-ONLY that I had.

Having said that, I 99.99% of the time, (perhaps) redundantly do "LSEXIT EXIT" - so, it's entirely possible.

That does make me think of another stupid mistake I did once: putting a logic with SEL-ONLY in BefRd on a file seemed to cause some kind of "infinite loop".

And since I'm really on a roll for stupidity: doing a field.refresh() in a Display Logic (what's worse, this one was on purpose) causes a dump - for what are now, obvious reasons :)

#4 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 06 November 2006 - 07:12 PM

LSEXIT EXIT



Thats like coders who put EXIT at the end of every logic, just to be sure ;)

Tell me you dont do that Rick.... please :)

Rob.

#5 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 06 November 2006 - 07:33 PM

:)
DSELF EXIT and DSEL EXIT are pretty normal/natural - I think LSEXIT EXIT (lol and FNEXIT EXIT) is just a bad habit :) Or perhaps even a bad learning assumption from way-back-when, when I thought that things should work logically in ProIV and then learned that they only do sometimes ;)

Oh I should add, I don't use EXIT if there are no subsequent logic statements within the logic - I can handle being partially stupid, but I'd hate to be thought of as completely stupid :D

Edited by Rick Young, 06 November 2006 - 07:35 PM.


#6 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 06 November 2006 - 07:37 PM

;)

I once knew someone who put EXIT at the end of every logic, just to make sure that it didnt run into the next logic (ie logic 1 running into logic 2).... :)

Rob.

#7 Chris Pepper

Chris Pepper

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:United Kingdom

Posted 07 November 2006 - 07:52 AM

I just get wound up by programmers who put in DSEL rather than DSEL EXIT; particularly in the first test out of 20 to be run on large numbers of records!

#8 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 07 November 2006 - 08:16 AM

Yep, DSEL EXIT is an exception we have in our standards....

And also FLD(x) EXIT, and MSG(x) EXIT also.

#9 George Macken

George Macken

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 248 posts
  • Gender:Male
  • Location:Co. Wicklow, Ireland

Posted 07 November 2006 - 09:44 AM

Hi

Why put in EXIT as the last statement of the logic ID - I do it out of habit now in most logics

but why did I start this ???

In the past (ver 1.5/2/2.2 times) we had a problem whereby a record / line was "missing" from an earlier entered logic statement - for example Lgc ID 001
lines 1-14 were present and visible in the @LOGIC - line/record 15 of logic 001 was missing - but lines 16+ were present in logic.pro but not visible in @LOGIC. We use various utilities while developing pro-iv (someting an external editor etc.,) and these could have been the cause of the corrupted lgc id.
The result was that only lines 1-14 were visible, but when the function was Genned then the logic of lines 16+ was also part of the executable.
This proved to be a real pain in the a.. when we were debugging this function, we just could not see that the lines 16+ were maniulpulating data, but it was not visible to us.

Subsequently, I decided on putting in the EXIT as last statement, it makes it obvious its the end of the logic and I dont have to worry about spurious logic lines that cannot be viewed in @Logic.

I just did a test now in 5.5 - removed a line from the middle of a logic statement (not thru @LOGIC, used a utility) - subsequently in @LOGIC only lines up to the earlier removed "missing" line are displayed, the compiled/genned function (5.5 on NT) does not make reference to the logic lines that are present after the "missin" logic line.

Rgds

George

#10 Mike Schoen

Mike Schoen

    Expert

  • Members
  • PipPipPipPip
  • 198 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 07 November 2006 - 02:29 PM

I'm trying to remember the exact reason why Rick and I have the habit of doing LSEXIT EXIT...(Yes, we work at the same place).

I think it has something to do with very early versions of pro-iv (1.5 or so). A linked ls (ie a search window) would leave the ls with "LSEXIT" when the record was selected, but we found that for some reason if you didn't to "LSEXIT EXIT" then the LSEXIT would get processed by the calling/parent ls as well.

In other words, LS 1 has a linked window to LS 2, LS 2 processes an LSEXIT, and you would terminate both ls's.
I haven't tried it without this in 5.5, its just a habit at this point.

#11 Rob Donovan

Rob Donovan

    rob@proivrc.com

  • Admin
  • 1,640 posts
  • Gender:Male
  • Location:Spain

Posted 07 November 2006 - 03:00 PM

I probably was only talking about 4.6 or 5.5 ;)

But I know I still do 1.5 things... Still cant use the 'DO' key and have to 'dot return' every where :)

Habits are hard to break...

Rob.

#12 Roger Rabiit

Roger Rabiit

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 07 November 2006 - 05:02 PM

And the worst crime of all - Commenting blank lines - Why Why Why!!!!

#13 Cleve Haynes

Cleve Haynes

    Expert

  • Members
  • PipPipPipPip
  • 172 posts
  • Gender:Male

Posted 07 November 2006 - 05:53 PM

And the worst crime of all - Commenting blank lines - Why Why Why!!!!


I agree - I hate this with a passion.

It also annoys the hell out of me people using version 5.5 that refuse to use the LS tag name when doing an LSCALL. Luddites we call them... :)

#14 andykay

andykay

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 204 posts
  • Gender:Male
  • Location:Cyberspace...looking for work

Posted 07 November 2006 - 07:58 PM

I just did a test now in 5.5 - removed a line from the middle of a logic statement (not thru @LOGIC, used a utility) - subsequently in @LOGIC only lines up to the earlier removed "missing" line are displayed, the compiled/genned function (5.5 on NT) does not make reference to the logic lines that are present after the "missin" logic line.


George,

I have experienced this problem of vanishing logic lines, too. I've only seen it happening while inserting a new line into pre-existing code and ProIV "stutters" while incrementing the total logic lines in the bootstrap file and fails to add the new line. As a result the LOGIC bootstrap file would look something like this for the sequence of logic lines in a logic number: 001,002,003,005,006,007.

Everything up to the missing line number would show up, but not the rest. I nearly ripped out all my hair when this first happened because I was inserting a new line at line 3~4 of a 100+ line logic and thought I had lost all the code I was developing. :)

I found the only way to fix this was to use a workfile utility to manually add the missing line into the LOGIC bootstrap file. After the bootstrap file had the correct number of lines for the logic and everything was in synch...All 100+ lines of logic re-appeared.

---------------------------------------------------------------

As for Pet Peeves about coding for this posting...If you see a blank line that is commented out and you don't like it, delete it...no one will notice :) . If you find an EXIT at the end of a logic statement and it's just nipping at your bud, delete it...no one will care ;) . Why ruin your day by harboring resentment towards a programmers' code because you wouldn't do it that way. Whose to say, other than yourself of course :D , that your code is perfect. Don't let your feathers get ruffled over something that really doesn't matter...JUST as long as the code works.

Peace To All.

AK
THE LIGHT AT THE END OF THE TUNNEL IS THE HEADLAMP OF THE TRAIN THAT'S ABOUT TO HIT YOU!!!

#15 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 07 November 2006 - 08:05 PM

I've had that happen before too Andy - I just hit add mode, and (to borrow from your example) Line 004 appeared, and then a record already in file for Line 005 - back to change mode and all of my logics were there intact.

This was using an alternative to Native's @MOD, also written in ProIV.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users