Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax help please...
Message
De
13/02/1999 11:49:25
 
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00187156
Message ID:
00187379
Vues:
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,

Thanks for the reply. Yes, I have the appropriately named textbox control on the form. But that wasn't the syntax error, the error was the empty line between the End Sub and Sub TotalPrice. I just figured it out this morning.

What's crazy is I simply pasted the code right out of the help file tutorial because I am trying to learn how to do some scripting. Well, I learned a little about VB syntax too. Bonus!<s>
Kendall Webb
Senior Software Engineer
MCAD.Net/MCSD.Net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform