Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * NU FUNCTIONEAZA FIINDCA LOOP-ul k=1ToX NU scaneaza decat primia line de cod atat ! Nush de ce.
- * De fapt ... ambele Loop-uri nu scaneaza decat prima Linie din fila, DE CE ?
- DIMENSION MyArray[1], MyLineArray[1]
- Z = ALINES(MyArray, FILETOSTR(szFileName),4 )
- szCopy = ''
- FOR i = 1 TO Z
- 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]
- 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
- *Copy before delete all the expresion from file into sCopy string
- sCopy = FILETOSTR(szFileName)
- *Make a new array and delete the line where is the product in a looop
- X = ALINES( MyLineArray, sCopy, 4 )
- * Delete file
- DELETE FILE datstocks_database.txt
- * Loop it
- FOR K = 1 TO X
- 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]
- MyLineArray[m.k] = CHR(0) && Null
- ELSE
- STORE szCopy+MyArrayLine[m.k]+CHR(13)+CHR(0) TO szCopy
- ENDIF
- NEXT
- STRTOFILE(szCopy, szFIleName, 1 )
- *Next-ul nu a fost Apelat
- *************************************
- RETURN .F.
- ENDIF
- RETURN .F.
- ENDIF
- MESSAGEBOX(' Produsul cautat nu este in stock, ne pare rau.' )
- RETURN .F.
- ENDFOR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement