Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I am very happy with the whole site and would like to extend my compliments to all of you who work to make it one of the most useful sites (If not THE Most Useful) ...and the easiest to navigate..."

Geography

Where in the world do Tek-Tips members come from?
amatureo (Programmer)
5 Aug 08 11:09
For years I have been annoyed by what appears to be a random crash in browse windows.  The back arrow will work most of the time to move the cursor back a column, but at other times it will crash the system.  I don't know how to figure this out.  
I'm using DOS Foxpro 2.5 on Win98SE and WinXP computers.

Any suggestions on how to troubleshoot this problem.
TamarGranor (Programmer)
5 Aug 08 15:59
I'd be suspicious of the FoxUser.DBF resource file. When the problem occurs, try renaming FoxUser.DBF so that FoxPro creates a new one and see if the problem goes away.

Tamar
DSummZZZ (Programmer)
6 Aug 08 10:38
You may also have a corrupted data or index file.  I would suggest you first create a backup of each, then pack, reindex, or even create new files and append from the old ones.  
See if that makes a difference.
 

  -Dave Summers-  
 cheers
Even more Fox stuff at:
http://www.davesummers.net/foxprolinks.htm

mmerlinn (Programmer)
6 Aug 08 12:40
I doubt that it is a FP problem.

I have the same problem on various websites on the internet.  Random crashes only when using the BS.  And only on computers using some sort of junk MS operating systems.

So, I suspect it is a problem in the PC operating system itself and not in any specific programming language.

mmerlinn

http://mmerlinn.com

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Steven Raymond

 

cricket (TechnicalUser)
6 Aug 08 16:59
There could be a key mapping command in the code somewhere which was not cleaned up properly, and only emerges in certain conditions.

ON KEY LABEL BACKSPACE DO myprogram
 
amatureo (Programmer)
7 Aug 08 9:58
I shouldn't have said back arrow.  I'm not talking about the backspace key, I'm talking about the left arrow.  I can't move left one column in a browse window without risking a crash.  It works more often than it crashes, but every crash is a problem.

I've even tried key mapping to disable the left arrow.  My thinking was that it would force the use of the enter key - moving right, looping back around to the desired column in the browse field.  I was unsuccessful in creating an ON KEY LABE LEFTARROW workaround.

Thanks for any other ideas.

 
amatureo (Programmer)
9 Aug 08 10:57
OK, here's the latest.

My workaround to prevent crashes when using the LEFT ARROW in a browse window is:

ON KEY LABEL LEFTARROW REPL(CHR(13),x)

x is the number of fields in the browse window minus 1.  This moves the cursor right until it ends up at the previous field.

This is clumsy, but it does prevent those unexplainable random program crashes. Because I start numerous browses with a memory variable I call BR_FIELD, I realize that x will always be the number of commas in BR_FIELD.

Example:
 
BR_FIELD=" BROW FIEL CODE:V=CODE#'  ',NAME,TYPE "

There are 3 fields accessed in the browse.  There are 2 commas in BR_FIELD.  I need to use:

ON KEY LABEL LEFTARROW REPL(CHR(13),2)

I just need to create a function that counts the number of commas in BR_FIELD.  I will write one if necessary, but are there existing functions in FPD which can count the number of occurrences of a character in a string?
amartureo (Programmer)
9 Aug 08 12:13
I went ahead and created my own function.  It requires a little more programming whenever I want to browse, but it does remedy the crashing.

FUNC OIS
* ------- O)ccurrences I)n S)tring --- Returns number
*         OIS_C - Character looked for
*         OIS_S - String to look in
PARA OIS_C,OIS_S
FOR i=1 TO 100  && Upper limit arbitrarily set at 100
 IF AT(OIS_C,OIS_S,i)=0
  RETU i-1
 ENDI
ENDF
RETU
* (EOF NOIS)
* ---------
 
mmerlinn (Programmer)
12 Aug 08 10:09
 
How about something like:

NumChar = LEN(OIS_S) - LEN(STRTRAN(OIS_S, OIS_C))

Not tested.


 

mmerlinn

http://mmerlinn.com

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Steven Raymond

 

amatureo (Programmer)
13 Aug 08 10:37
I guess I'm stuck with the extra code required before each browse window is opened in my programs.

ON KEY LABEL LEFTARROW KEYB REPL(CHR(13),x)

x is the number of fields in the browse window minus 1.  This moves the cursor right until it wraps around and stops at the previous field.

This is NOT a perfect solution.  I have some browse windows that access a variable number of the fields depending on information in other fields.  The left arrow in those cases doesn't always position the cursor correctly.  I also have to remember to ON KEY LABEL LEFTARROW after each browse or users have problems when they try to left arrow in other parts of the program.

I would prefer for the LEFTARROW to execute correctly without special workarounds, but I've been unsuccessful in error trapping the random LEFTARROW system crash. There must be a way, but ALAS, I may have to give up the pursuit.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close