Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax help please...
Message
 
To
12/02/1999 15:12:51
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00187156
Message ID:
00187369
Views:
15
>I am using the following code directly from the MS Script Control Help file to create a demo script form. The compiler says that this code has a syntax error in the txtScript.Text definition. As I am NOT a VB effecianato, can anyone point me to the syntax error?
>
>Private Sub Form_Load()
> ' Add MyObject to the Script Control. This adds
> ' the run-time functionality of the object to the
> ' control.
> scDemo.AddObject "objScript", MyObject
> ' Add script to Textbox control.
> txtScript.Text = _
> "Sub SetRate()" & vbCrLf & _
> " Dim Rate" & vbCrLf & _
> " Rate = InputBox(""TaxRate:"",,.086)" & _
> vbCrLf & _
> " objScript.Rate = Rate" & vbCrLf & _
> "End Sub" & vbCrLf & vbCrLf & _
>
>"Sub TotalPrice()" & vbCrLf & _
> " Dim price, ttl" & vbCrLf & _
> " price = InputBox(""Price:"",,100)" & _
> vbCrLf & _
> " ttl =objScript.TaxIt(price)" & vbCrLf & _
> " MsgBox ttl" & vbCrLf & _
> "End Sub"
>End Sub
>
>TIA,

On your form, do you have a textbox control with its name property set to txtScript? If you don't, it will never work.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform