Development Experience Skills - Shortcuts in Vfp Development Cause Program Execution Path Abnormal, Bug? ?

Recently , efforts have been made to graft the data storage part of vfp into the mysql database, so as to get rid of the data table that comes with vfp. Before reprogramming and adding code, the original program directory was backed up, and the program directory was renamed again. Encountered a big and small trouble, but the final solution was unexpectedly simple, but it took a lot of trouble just to find the cause of the problem.

     Let’s not talk about the function of the program, the key is that a dll file in the directory needs to be read during the running process of the program, but the value read to the file every time the program is compiled and run is not the content originally stored in it, looking at this number, the total It's inexplicable, but I feel that this number has been used before, but I have obviously updated the dll, why the content remains the same. Try running the main program file directly in the vfp environment - normal! Return to run the program, or not, is the program not reading files from this directory? So remove the dll file, run the program, strange things appear, it can run normally, and even the dll file can be read, of course, the data is still what content. It seems that you guessed right, the dll file read is not the current program directory. That is to say, the default execution path of the program is not the current directory. Which directory is that? In order to find the running directory, directly add a function that returns the current path to the code in different form codes. Everyone knows that this is curdir(), execute it again, and the prompt comes out. It is actually the backup directory. Why, I am obviously not there. Modify and run in the directory! ! Could it be that there is an omission in the incomplete code change? I looked through each program code carefully, but I didn’t find it. I simply added curdir() to the main program file, and the running prompt found that the current path has changed from the very beginning. This is not right! ! Think carefully about where I might go wrong. First of all, my program is run using the shortcut originally sent to the desktop. Check the path of the shortcut. It is correct. It has already pointed to my compilation directory, and the file is also normal. I've changed the shortcut's path after the backup. Deleted it and sent it to the desktop shortcut again, running it again. . . . . It's ok, what's going on. It's that simple? why? Why directly modifying the shortcut does not work, but re-creating the shortcut is normal? Their content is the same! ! It seems that there are still imperfections in the operation and use of vfp. I hope that friends will pay attention to these in use. At least not like me tossing for a long time only to find that it is such a trivial mistake! !

Note: Time of first writing: 2011-05-12 in Baidu space

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326187789&siteId=291194637