| 
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                     
                                        
                                     
                                    
                                        
                                        - 超级版主
 
                                        
                                        - 1228894
 
                                        - 27060
 
                                        - 25
 
                                        - 8236 朵
 
                                        - 36314 个
 
                                        - 4931 个
 
                                        - 421340
 
                                        - 2012-07-18
 
                                     
                                    
                                    
                                    
                                 | 
                                
                                    
                                        
                                            
                                                
                                                1#
                                                
                                            
                                        
                                        
                                            
                                                
                                                
                                                t
                                                T
                                             
                                            
                                            
                                            
                                                
                                                发表于 2022-02-20 22:21
                                            
                                                                                        
                                            | 
                                            
                                            
                                            |只看楼主
                                            
                                         
                                     
                                    
                                    
                
                
                
                
                    
                    
                    
                   
                    
                        
                        
                        功能说明:1.  自动生成指定"字符串"的分割代码2.  自动生成处理历史(仿人处理思维),并可通过双击第几次的字眼,直接生成对应分割代码3.  偷懒、便于新人理解与学习效果一览:   源码一览:- Event Form1.Button1.Click
  
-     PutAttachment "c:\","*.txt"   
  
-     Form1.ListBox1.List = "" 
  
-     总内容 = Form1.InputBox1.Text
  
-     要取内容 = Form1.InputBox2.Text
  
-     Form1.ListBox1.AddItem "需要取对象--" & 要取内容
  
-     对象位置=instr(总内容, 要取内容)
  
-     If 对象位置 = 0 Then 
  
-         Form1.ListBox1.AddItem "对象不存在获取失败..."
  
-         Exit Event
  
-     End If
  
-     Form1.ListBox1.AddItem "对象位置--" & 对象位置
  
-     For i = 1 To 30
  
-         Form1.ListBox1.AddItem "====================="
  
-         Form1.ListBox1.AddItem "第" & i & "次提取"
  
-         第一次分割=Mid(总内容,对象位置-i,i)
  
-         Form1.ListBox1.AddItem "第一次分割字符串--" & 第一次分割
  
  
-         第二次分割=Mid(总内容, (对象位置 + len(要取内容)), i)
  
-         Form1.ListBox1.AddItem "第二次分割字符串--" & 第二次分割
  
-         分割 = GetStrAB(总内容, 第一次分割, 第二次分割)
  
-         Form1.ListBox1.AddItem "结果--" & 分割
  
-         If 分割 = 要取内容 Then 
  
-             Exit Event
  
-         End If
  
-     Next
  
- End Event
  
- Function GetStrAB(Str, StrA, StrB)
  
-     Dim i,ArrStrA,Ck
  
-     ArrStrA=Split(Str,StrA)
  
-     For i = 1 To UBound(ArrStrA)
  
-         If InStr(ArrStrA(i), StrB) > 0 Then Ck = Ck & Split(ArrStrA(i),StrB)(0) &"*"
  
-     Next
  
-     If UBound(split(ck, "*")) = 1 Then 
  
-         GetStrAB=Replace(ck,"*","")
  
-     Else 
  
-         GetStrAB=Ck
  
-     End If
  
- End Function
  
- Event Form1.ListBox1.DblClick
  
-     第一次分割内容 = split(split(Form1.ListBox1.List, "|")(Form1.ListBox1.ListIndex + 1), "--")(1)
  
-     第一次分割内容 = chr(34)& Replace(第一次分割内容, chr(34), chr(34) & chr(34))&chr(34)
  
-     TracePrint 第一次分割内容
  
-     第二次分割内容 = split(split(Form1.ListBox1.List, "|")(Form1.ListBox1.ListIndex + 2), "--")(1)
  
-     第二次分割内容= chr(34)&Replace(第二次分割内容,chr(34),chr(34)&chr(34))&chr(34)
  
-     TracePrint 第二次分割内容
  
-     Text = Replace( Plugin.File.ReadFileEx("C:\生成分割代码.txt"),"|",vbcrlf)
  
-     第一行= "TracePrint GetStrAB(总内容, "&第一次分割内容&","&第二次分割内容&")"
  
-     Call Plugin.Sys.SetCLB(第一行 & vbcrlf & Text)
  
-     MessageBox "生成代码成功. ..."
  
- End Event
  
  复制代码 源文件下载:  - SCFG.rar                                                                                                                                                                                                                                                       (, 下载次数:493)
    
                        
                     
                    
                    
                    
                    
                    
                    
                    
                    
                        
                        
                     
                     |