SHARE
TWEET

Untitled

a guest Apr 19th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. * NU FUNCTIONEAZA FIINDCA LOOP-ul k=1ToX NU scaneaza decat primia line de cod atat ! Nush de ce.
  2. * De fapt ... ambele Loop-uri nu scaneaza decat prima Linie din fila, DE CE ?
  3.  
  4.     DIMENSION MyArray[1], MyLineArray[1]
  5.     Z = ALINES(MyArray, FILETOSTR(szFileName),4 )
  6.     szCopy = ''
  7.  
  8.     FOR i = 1 TO Z
  9.         IF ALLTRIM(Thisform.text1.Value) $ MyArray[m.i] AND ALLTRIM(Thisform.text2.Value) $ MyArray[m.i] AND ALLTRIM(Thisform.text3.Value) $ MyArray[m.i] AND ALLTRIM(Thisform.text4.Value) $ MyArray[m.i]
  10.             IF MESSAGEBOX('Produsul cautat inca se afla in stock.'+CHR(13)+CHR(10)+'(Nume firma|Model masina|Piesa/Produsul|Anul|Stare|Pret)' +CHR(13) + CHR(10) + MyArray[m.i] + CHR(10) + CHR(13) + 'Doriti sa stergeti acest produs din stock ?', 4+32 ) = 6            
  11.                
  12.                 *Copy before delete all the expresion from file into sCopy string
  13.                 sCopy = FILETOSTR(szFileName)
  14.                
  15.                 *Make a new array and delete the line where is the product in a looop
  16.                 X = ALINES( MyLineArray, sCopy, 4 )
  17.            
  18.                 * Delete file
  19.                 DELETE FILE datstocks_database.txt
  20.                
  21.                 * Loop it
  22.                 FOR K = 1 TO X
  23.                     IF ALLTRIM(Thisform.text1.Value) $ MyArray[m.i] AND ALLTRIM(Thisform.text2.Value) $ MyArray[m.i] AND ALLTRIM(Thisform.text3.Value) $ MyArray[m.i] AND ALLTRIM(Thisform.text4.Value) $ MyArray[m.i]
  24.                         MyLineArray[m.k] = CHR(0) && Null
  25.                     ELSE
  26.                         STORE szCopy+MyArrayLine[m.k]+CHR(13)+CHR(0) TO szCopy
  27.                     ENDIF
  28.                 NEXT
  29.                     STRTOFILE(szCopy, szFIleName, 1 )
  30.                     *Next-ul nu a fost Apelat
  31.                     *************************************
  32.                 RETURN .F. 
  33.             ENDIF
  34.             RETURN .F.
  35.         ENDIF
  36.             MESSAGEBOX(' Produsul cautat nu este in stock, ne pare rau.' )
  37.             RETURN .F.
  38.     ENDFOR
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top