Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting a Insert Blank at Begining of File
Message
De
14/09/2013 07:52:34
 
 
À
14/09/2013 05:12:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01583256
Message ID:
01583264
Vues:
42
lcCursor = 'yourcursor'
alter table (lcCursor) add column lineno I  
select (lcCursor)
replace all lineno with recno() * 10
index on lineno tag lineno
Go top
Scan
   IF STREXTRACT(PS,'(',')')='Usage Charges' AND LEFT(PS,1)='F'
      NEWPS='N '+ALLTRIM(STR(posC-2))+' '+ALLTRIM(STR(posR+7))+' '+ALLTRIM(STR(m.BoxEndcolumn-posC))+' '+'-8 i'
      lnCurrentLine = lineno - 1
      insert into (lcCursor) (lineno, ps) values (lnCurrentLine , NEWPS )
   ELSE
   ENDIF
ENDSCAN   
>Sorry, I didn't got/understood what you said. Please Explain in detail.
>I need to insert a Blank record if my Data is matched during scan & Endscan. The code Which I have shown below does not work if the Matching record is found on record number 1 itself, as Skip-1 does not work here.
>
>Is there any other way, please Guide in detail
>
>
>
>
>>That's not a good idea, for many reasons. Instead you add a numeric column which keeps track of the line number.
>>
>>>I am Using the following code to Insert a Record. However, if the original record is at the Begnining of File i.e if RECNO()=1, I am not able to insert a Blank record before my original record.
>>>
>>>Thus if my STREXTRACT(PS,'(',')')='Usage Charges' AND LEFT(PS,1)='F' is found at the begin of File I need to insert one Blank record before it.
>>>
>>>
>>>
>>>Go top
>>>Scan
>>>IF STREXTRACT(PS,'(',')')='Usage Charges' AND LEFT(PS,1)='F'
>>>NEWPS='N '+ALLTRIM(STR(posC-2))+' '+ALLTRIM(STR(posR+7))+' '+ALLTRIM(STR(m.BoxEndcolumn-posC))+' '+'-8 i'
>>>Skip-1 && Pointer Skips one record above 
>>>INSERT BLANK
>>>Replace PS With NEWPS
>>>Skip Pointer comes Back to Orignal Position
>>>ELSE
>>>ENDIF
>>>ENDSCAN				
>>>
>>>
>>>
>>>Kindly Guide
>>F
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform