Guidance
指路人
g.yi.org
software / rapidq / Examples / String & Text / Delete by delimiters.bas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
'From:  "taplang <wasaywasay@e...>" Sat Jan 4, 2003  1:27 am
'Subject:  Re: Finding Text Between 2 Characters and deleting it

     DECLARE SUB DelWord

     CREATE Form AS QFORM
      Center
      CREATE RichEdit AS QRICHEDIT
       Width = 312
       Align = 1
       ADDSTRINGS "<a href=r/ab>Addresses</a>"
       ADDSTRINGS "<a href=r/bc>Briefcase</a>"
       ADDSTRINGS "<a href=r/ca>Calendar</a>"
       ADDSTRINGS "<a href=r/i2>My Yahoo!</a>"
       ADDSTRINGS "<a href=r/pp>PayDirect</a>"
       ADDSTRINGS "<a href=r/fo>Photos</a>"
      END CREATE
      CREATE Button AS QBUTTON
       CAPTION = "Click me"
       Top = 130
       Width = 312
       OnClick = DelWord
      END CREATE
     END CREATE

     SUB DelWord
      text$ = RichEdit.Text
      count = TALLY(text$,">")
      IF count = 0 THEN EXIT SUB
      FOR x = 1 TO count
       start = (delimit2 + 1) - lenofdelword
       delimit1 = INSTR(start,text$,"<")
       delimit2 = INSTR(start+1,text$,">")
       lenofdelword = (delimit2 - delimit1) - 1
       text$ = DELETE$(text$,delimit1+1,lenofdelword)
      NEXT
      text$ = text$ - "<>" 'optional if want to delete the delimiters also
      RichEdit.Text = text$
     END SUB

     Form.SHOWMODAL
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2019-4-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-01-04 10:18:51