Guest User

Untitled

a guest
Sep 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. CREATE Cursor delete_cursor(salesno c(6), release_number c(3))
  2. SELECT table1
  3. GOTO TOP
  4. **lcsono** = table1.salesno
  5. **lcrelease** = table1.release_number
  6. GOTO 2
  7. SCAN REST
  8. ** In VFP, semi-colon is continuation of command
  9. IF table1.salesno == lcsono ;
  10. AND table1.release_number <> "000";
  11. AND lcrelease = "000"
  12.  
  13. SELECT delete_cursor
  14. APPEND BLANK
  15. REPLACE table1.salesno WITH lcsono
  16. REPLACE table1.release_number WITH lcrelease
  17. SELECT table1
  18. ENDIF
  19.  
  20. **lcsono** = table1.salesno
  21. **lcrelease** = table1.release_number
  22. ENDSCAN
  23.  
  24. SELECT delete_cursor
  25. INDEX on ALLTRIM(delete_cursor.salesno) + ALLTRIM(delete_cursor.releaseno);
  26. TAG tagdelete
  27.  
  28. SELECT table1
  29. GOTO TOP
  30. SCAN
  31. IF SEEK(ALLTRIM(table1.salesno) + ALLTRIM (table1.salesno), ;
  32. "delete_cursor", "tagdelete")
  33.  
  34. REPLACE table1.delflag WITH "Y"
  35. ENDIF
  36. ENDSCAN
  37.  
  38. DECLARE CURSOR @fsono char(6)
  39. update table1.salesno Set
  40. table1.salesno = @fsono
  41. where
  42. @fsono = table1.salesno
  43. AND table1.release_number <> "000"
  44. AND lcrelease = "000"
  45.  
  46. DECLARE CURSOR @release char(6)
  47.  
  48. update table1.release_number Set
  49. table1.release_number = @release
  50. where
  51. @fsono = table1.salesno
  52. AND table1.release_number <> "000"
  53. AND @release = "000"
Add Comment
Please, Sign In to add comment