See more articles about "Programming "

Beheld Basal Archetypal Approved Announcement Tester



 19 July 01:28   =Introduction=

    This is a actual baby program that demonstrates that advantageous programs do not charge to be large. While dabbling with the abstraction of automatic download and body of antecedent included in Wikibooks I bare to analysis some . I searched the Web for accessible create accoutrement but begin annihilation that absolutely adapted what I capital to do. Eric Gunnersons C# apparatus is actual acceptable but relies on the .NET libraries which seems an unnecessarily ample aerial for such a baby program. So I congenital my own in about fifteen minutes. Actuality it is, it has the bald minimum of absurdity checking, the controls are not neatly abiding and the anatomy is not resizeable, or rather it is but the controls dont. It has a lot of limitations and absolutely needs improvement, see .

    =frmRegExpTester.frm=

    This anatomy is the alone bore in the program. All the difficult plan is done by the VBScript Approved Announcement Library. See .

    The ascendancy blueprint on the anatomy is just what first came to mind. It absolutely needs improvment in several areas: resizeability, tab order, etc.

    There is a ascendancy for anniversary of the backdrop and methods of the RegExp chic so you can exercise all of the capabilities of it. anniversary of the controls reacts to the Afflicted Bang contest by ambience backdrop as adapted and calling both the Analysis and Assassinate methods.

     Adaptation 5.00

     Activate VB.Form frmRegExpTester

     Explanation = Form1

     ClientHeight = 11700

     ClientLeft = 60

     ClientTop = 360

     ClientWidth = 11010

     BeginProperty Chantry

     Name = System

     Admeasurement = 9.75

     Charset = 0

     Weight = 700

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     LinkTopic = Form1

     ScaleHeight = 11700

     ScaleWidth = 11010

     StartUpPosition = 3 Windows Default

     Activate VB.TextBox txtTestresult

     BeginProperty Chantry

     Name = Fixedsys

     Admeasurement = 9

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 495

     Larboard = 1320

     TabIndex = 10

     Argument = Text1

     Top = 2880

     Amplitude = 4095

     End

     Activate VB.TextBox txtExecuteresult

     BeginProperty Chantry

     Name = Fixedsys

     Admeasurement = 9

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 9135

     Larboard = 6840

     MultiLine = -1 True

     TabIndex = 9

     Argument = frmRegExpTester.frx:0000

     Top = 2520

     Amplitude = 4095

     End

     Activate VB.TextBox txtReplace

     BeginProperty Chantry

     Name = Fixedsys

     Admeasurement = 9

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 615

     Larboard = 960

     MultiLine = -1 True

     TabIndex = 5

     Argument = frmRegExpTester.frx:0006

     Top = 1440

     Amplitude = 8295

     End

     Activate VB.CheckBox chkMultiLine

     Explanation = Multiline

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 495

     Larboard = 3360

     TabIndex = 4

     Top = 840

     Amount = 1 Checked

     Amplitude = 1575

     End

     Activate VB.CheckBox chkIgnoreCase

     Explanation = Avoid Case

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 375

     Larboard = 1800

     TabIndex = 3

     Top = 960

     Amount = 1 Checked

     Amplitude = 1575

     End

     Activate VB.CheckBox chkGlobal

     Explanation = Global

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 375

     Larboard = 240

     TabIndex = 2

     Top = 960

     Amount = 1 Checked

     Amplitude = 1455

     End

     Activate VB.TextBox txtPattern

     BeginProperty Chantry

     Name = Fixedsys

     Admeasurement = 9

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 615

     Larboard = 840

     MultiLine = -1 True

     TabIndex = 1

     Argument = frmRegExpTester.frx:000C

     Top = 120

     Amplitude = 8535

     End

     Activate VB.TextBox txtSource

     BeginProperty Chantry

     Name = Fixedsys

     Admeasurement = 9

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 6735

     Larboard = 0

     MultiLine = -1 True

     TabIndex = 0

     Argument = frmRegExpTester.frx:0022

     Top = 4920

     Amplitude = 5655

     End

     Activate VB.Label Label3

     Explanation = Analysis status

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 255

     Larboard = 0

     TabIndex = 11

     Top = 3000

     Amplitude = 1215

     End

     Activate VB.Label Label2

     Explanation = Assassinate status

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 255

     Larboard = 5520

     TabIndex = 8

     Top = 2640

     Amplitude = 1215

     End

     Activate VB.Label Label1

     Explanation = Replacement

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 375

     Basis = 1

     Larboard = 0

     TabIndex = 7

     Top = 1560

     Amplitude = 735

     End

     Activate VB.Label Label1

     Explanation = Pattern

     BeginProperty Chantry

     Name = MS Sans Serif

     Admeasurement = 8.25

     Charset = 0

     Weight = 400

     Accentuate = 0 False

     Italic = 0 False

     Strikethrough = 0 False

     EndProperty

     Acme = 375

     Basis = 0

     Larboard = 0

     TabIndex = 6

     Top = 240

     Amplitude = 735

     End

     End

     Aspect VB_Name = frmRegExpTester

     Aspect VB_GlobalNameSpace = False

     Aspect VB_Creatable = False

     Aspect VB_PredeclaredId = True

     Aspect VB_Exposed = False

     Advantage Explicit

    The RegExp instance is accessible to all the cipher in this bore although this is not carefully all-important because we could make a new one anniversary time.

     Clandestine added As RegExp

    Each of the Boolean backdrop is represented by a CheckBox control. The bang accident for anniversary one artlessly sets the adapted acreage amount and calls the Assassinate adjustment via the xExecute bounded subroutine.

     Clandestine Sub chkGlobal_Click()

     moRe.Global = chkGlobal = vbChecked

     xExecute

     End Sub

     Clandestine Sub chkIgnoreCase_Click()

     moRe.IgnoreCase = chkIgnoreCase = vbChecked

     xExecute

     End Sub

     Clandestine Sub chkMultiLine_Click()

     moRe.MultiLine = chkMultiLine = vbChecked

     xExecute

     End Sub

    When the anatomy is created the Initialize accident abettor is called. This creates the RegExp instance and sets the backdrop to accord to the ethics of the controls.

     Clandestine Sub Form_Initialize()

     Set added = New RegExp

     With moRe

     .Global = chkGlobal = vbChecked

     .IgnoreCase = chkIgnoreCase = vbChecked

     .MultiLine = chkMultiLine = vbChecked

     .Pattern = txtPattern

     End With

     End Sub

    When the user changes either the approved announcement or the antecedent argument the achievement is adapted by calling xExecute

     Clandestine Sub txtPattern_Change()

     xExecute

     End Sub

     Clandestine Sub txtSource_Change()

     xExecute

     End Sub

    This is the affection of the program. All it does is to alarm the Assassinate adjustment and then assemble a cord to represent the result. If the arrangement is invalid then the Assassinate adjustment will accession an error. this is trapped and the absurdity description acclimated instead of the result. The aftereffect item is declared as Item because the acknowledgment blazon can be either Bout or MatchCollection depending on whether there is alone one bout or added than one. The after-effects are apparent in the txtExecuteResult and txtTestresult argument boxes.

     Clandestine Sub xExecute()

     moRe.Pattern = txtPattern

     Dim o As Object

     On Absurdity Resume Next

     Set o = moRe.Execute(txtSource)

     If Err Then

     txtExecuteresult = Err.Number & , & Err.Description

     Else

     On Absurdity GoTo 0

     If TypeOf o Is Bout Then

     txtExecuteresult = xMatchToString(o)

     ElseIf TypeOf o Is MatchCollection Then

     txtExecuteresult = xMatchCollectionToString(o)

     End If

     End If

     On Absurdity GoTo 0

    

     On Absurdity Resume Next

     txtTestresult = moRe.Test(txtSource)

     If Err Then

     txtTestresult = Err.Number & , & Err.Description

     End If

     On Absurdity GoTo 0

     End Sub

    The accomplished purpose of the program is to appearance the user what the aftereffect of analogous the approved announcement to a argument cord will be. To do this we artlessly make a cord that represents a Bout or MatchCollection object.

     Clandestine Action xMatchCollectionToString(ByRef roMatchCollection As MatchCollection) As String

    

     Dim lX As Long

     With roMatchCollection

     xMatchCollectionToString = .Count: & .Count & vbCrLf

     For lX = 0 To .Count - 1

     xMatchCollectionToString = xMatchCollectionToString _

     & Account & lX & vbCrLf _

     & xMatchToString(.Item(lX))

     Next lX

     End With

    

     End Function

    

     Clandestine Action xMatchToString(ByRef roMatch As Match) As String

    

     With roMatch

     xMatchToString = .FirstIndex: & .FirstIndex & vbCrLf _

     & .Length: & .Length & vbCrLf _

     & .Value: & .Value & vbCrLf _

     & .SubMatches: & vbCrLf _

     & xSubMatchesToString(.SubMatches) & vbCrLf

    

     End With

    

     End Function

    

     Clandestine Action xSubMatchesToString(ByRef roSubMatches As SubMatches) As String

    

     Dim lX As Long

     With roSubMatches

     xSubMatchesToString = .Count: & .Count & vbCrLf

     For lX = 0 To .Count - 1

     xSubMatchesToString = xSubMatchesToString _

     & Account & lX & vbCrLf _

     & & .Item(lX) &

     Next lX

     End With

    

     End Function

    =regexptester.vbp=

    The activity book is actual simple. No abnormal references except the approved announcement library.

     Type=Exe

     Reference= Reference= Form=frmRegExpTester.frm

     Startup=frmRegExpTester

     HelpFile=

     Title=prjGet

     Command32=C:userskjwhomepagewebsitevbwikirepositoryJarithmetic_Round_Two_Implementation.html

     Name=prjRegExpTester

     HelpContextID=0

     CompatibleMode=0

     MajorVer=1

     MinorVer=0

     RevisionVer=0

     AutoIncrementVer=0

     ServerSupportFiles=0

     VersionCompanyName=

     CompilationType=0

     OptimizationType=0

     FavorPentiumPro(tm)=0

     CodeViewDebugInfo=0

     NoAliasing=0

     BoundsCheck=0

     OverflowCheck=0

     FlPointCheck=0

     FDIVCheck=0

     UnroundedFP=0

     StartMode=0

     Unattended=0

     Retained=0

     ThreadPerObject=0

     MaxNumberOfThreads=1

    


 


 false, underline, charset, italic, endproperty, strikethrough, beginproperty, weight, tabindex, height, width, private, frmregexptester, vbcrlf, xexecute, error, caption, serif, multiline, execute, value, string, function, vbchecked, expression, count, regular, attribute, match, textbox, xmatchcollectiontostring, regexp, fixedsys, xsubmatchestostring, txtexecuteresult, program, click, object, xmatchtostring, matchcollection, result, chkmultiline, checkbox, txttestresult, properties, controls, chkglobal, chkignorecase, label, pattern, txtpattern, txtsource, submatches, description, control, method, global, byref, checked, , false strikethrough, false italic, false endproperty, font name, beginproperty font, endproperty height, 400 underline, weight 400, private sub, sans serif, serif size, regular expression, fixedsys size, xexecute end, name fixedsys, height 375, text frmregexptester, true tabindex, frmregexptester frx, sub private, error goto, private function, vbchecked xexecute, execute method, click more, checked width, beginproperty font name, false endproperty height, sans serif size, name fixedsys size, font name fixedsys, ignorecase chkignorecase vbchecked, global chkglobal vbchecked, multiline chkmultiline vbchecked, function private function, label label1 caption, error resume next, checked width 1575, basic classic regular, regular expression library, visual basic classic, classic regular expression, regular expression tester, status beginproperty font,

Share Beheld Basal Archetypal Approved Announcement Tester:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Programming LearnByExample Bittersweet 1.8.3 Accumulation
Ruby is an interpreted language. There is no compiling. Save a program in whatever.rb, and run bittersweet whatever.rb from the command line.Type irb at the command line. This will accompany up an alternate bittersweet carapace area you can analysis some ideas.When active interactivel

Programming LearnByExample Bittersweet 1.8.3 Data
irb(main):001:0 a = first String = first String irb(main):002:0 b = additional String = additional String irb(main):003:0 puts a + + b first Cord additional String = nil irb(main):004:0 carol = 15 = 15 irb(main):005:0 intTwo = 23 = 23 irb

Programming LearnByExample Bittersweet 1.8.3 Ascendancy breeze
irb(main):001:0 testInt = 15 = 15 irb(main):002:0 if testInt 17 irb(main):008:1 puts testInt is according to 17 irb(main):009:1 else irb(main):010:1 irb(main):011:1 end ascendancy create it to the final block = nilI charge to see if Ruby, like Java, has

Programming LearnByExample Bittersweet 1.8.3 Functions
irb(main):001:0 def printSomething(toPrint) irb(main):002:1 puts toPrint irb(main):003:1 end = nil irb(main):004:0 printSomething(Hello World) Accost World = nil irb(main):005:0 printSomething(23) 23 = nilUnlike Python, a action will not attendi

Programming LearnByExample CSharp Exceptions
All Exceptions haveto be acquired from System.Exception. If you wish to make your own custom Exception, it haveto be acquired from System.ApplicationException.In Java, a adjustment has to acknowledge what affectionate of Exceptions are befuddled in the body. You do not do this in C. using

Beheld Basal .NET Collections
VB.NET supports a amount of data structures alleged Collections. Accumulating can be either aught or one based, depending on how they are declared. A accumulating is agnate to an arrangement in that it can abundance assorted data entries. However, alotof collections accept avant garde methods associ

Programming LearnByExample CSharp Assembly
A agent in absolute activity is anyone who does something on account of anyone else. A agent in C is a adjustment that does an activity for addition method.Kind of the agnate to action pointers in C, but they are typed (by ambit passed, and acknowledgment type).Heres my brainless examp

Programming LearnByExample CSharp Contest
C uses the publish/subscribe architecture arrangement from the [http://www.amazon.com/exec/obidos/tg/detail/ /0201633612/104 7005310 9851914?v=glance assemblage of four]. Contest are acclimated in affiliation with delegates.An accident abettor is a agent which handles the event. Accident

Beheld Basal .NET Accepting Started
To activate programming in Beheld Basal .NET, you can either abridge anon from the command band with the .NET [http://www.microsoft.com/downloads/details.aspx?familyid=9B3A2CA6 3647 4070 9F41 A333C6B9181D&displaylang=en SDK], use [http://msdn.microsoft.com/howtobuy/vstudio/ Microsofts Beheld Flat ID

Beheld Basal .NET Addition
Beheld Basal .NET is the next bearing of Microsofts accepted Beheld Basal programming languages. Some programmers accredit to the new apotheosis as VB 7, but this is incorrect. Beheld Basal .NET is infact not backwards compatible with VB6, acceptation that cipher accounting in the old adaptation w