From: WatsonR@IntelligenCIA.com   
      
   "D & J G" wrote in message   
   news:44128b0c$0$14239$afc38c87@news.optusnet.com.au...   
   >   
      
   > When running, as soon as the code gets to   
   > myDebug   
   > I get the message   
   >   
   > Compile Error:   
   > "Argument not optional"   
   >   
      
   the routine expect a string to be passed. If you omit it, you will get an   
   error.   
   If you use a variable, make sure the variable is declared as a string, e.g   
      
   Dim mystr as String   
   ...   
   mystr = "Getting user network ID."   
   call myDebug(mystr)   
      
   if not, you'll get a byref argument type mismatch. test out the routine by   
   itself   
   Just create a form with a button:   
      
   Private Sub Command1_Click()   
   Dim mystr As String   
   mystr = "Cmd 1 Pressed"   
    Call myDebug(mystr)   
   End Sub   
      
   Sub myDebug(mystr$)   
    Dim f$   
    f$ = App.Path & "\debug.txt"   
    Open f$ For Append As #1   
    Print #1, mystr$   
    Close   
   End Sub   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|