home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,953 of 10,840   
   Raoul Watson to donandjane@optusnet.com.au   
   Re: Unexpected Error!!   
   11 Mar 06 12:51:07   
   
   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)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca