Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Showing memo contents in a grid for more than 1 record
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00838488
Message ID:
00838493
Vues:
24
See corrections inline

>I have a piece of code which gives me a set of records in a cursor. For each record in the cursor is a memo field. Here is the cursor code:
>
>
>SELECT * FROM pdmlog ;
>WHERE pdmlog.type="Change" and pdmlog.database="MODACAD" ;
>and BETWEEN(date,{^2003-10-14},{^2003-10-14}) ;
>INTO CURSOR result
>
>
>I then want to strip the memo field to find out what data has been changed using the code below:
>
>
>CREATE CURSOR CrsResult ( FieldName c(15), OldLen I, NewLen I, OldData c(32), ;
>NewData c(32), Mainkey c(fsize('mainkey','result')))

SELECT result
SCAN

SELECT CrsResult
SCATTER NAME oRec BLANK

>lcmemo = result.data
>lnCnt = 1
>lnpos = AT("xxx",lcmemo, lnCnt)
>
>DO WHILE lnPos > 0
>	oRec.NewLen = INT(VAL(SUBSTR(lcmemo,lnpos-10,5)))
>	oRec.OldLen = INT(VAL(SUBSTR(lcmemo,lnpos-5,5)))
>	oRec.FieldName = SUBSTR(lcmemo, lnpos+3, 10)
>	oRec.Mainkey = result.mainkey
>	
>	lnValPos = lnPos + 13
>	oRec.NewData = SUBSTR(lcmemo, lnValPos, oRec.NewLen)
>	IF oRec.OldLen > 0
>		oRec.OldData = SUBSTR(lcmemo, lnValPos + oRec.NewLen, oRec.OldLen)
>	ELSE
>		oRec.OldData = ""
>	ENDIF
>	
>	APPEND BLANK
>	GATHER NAME oRec
>
>	lnCnt = lnCnt + 1
>	lnPos = AT("xxx", lcmemo, lnCnt)
>ENDDO

ENDSCAN
>
>
>This works absolutely fine. BUT ONLY FOR THE FIRST RECORD IN MY ORGINAL CURSOR!!!
>
>I will then display all of the contents in a grid!!
>
>I want crsResult cursor to hold all the stripped memo contents for all records in my original cursor. I think I may need a do command!!
>
>Can anybody help me please!
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform