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 8,934 of 10,840   
   Olof Lagerkvist to All   
   Re: Right$ doesn't work   
   31 Oct 04 13:46:21   
   
   From: no@email.address   
      
   Bo Wisén wrote:   
      
   > "Olof Lagerkvist"  skrev i meddelandet   
   > news:YK4hd.7559$d5.63558@newsb.telia.net...   
   > : Bo Wisén wrote:   
   > :   
   > : > Hi,   
   > : >   
   > : > A project in VB6 recently worked without any problems but now it's   
   > : > complaining when I try to use 'Right$'. In immediate mode, when I'm   
   > typing   
   > : > 'print left$("123456",2)' I get the correct result '12'. When I type   
   > 'print   
   > : > right$("123456",2) I expect the result '56' but all I get is an error   
   > 'type   
   > : > declaration does not match declared data type'. And I can't find that I   
   > have   
   > : > tried to declare 'right'. Can anyone explain what can cause this   
   > problem?   
   > :   
   > : The problem may be that Right() is defined in another library referenced   
   > : in your project.   
   > :   
   > : Try to use the full object path to the Right() function, like:   
   > : Print VBA.Strings.Right("123456", 2)   
   > :   
   > : If you want to know where the other "Right" is defined, press F2 to open   
   > : the Object Browser and search for Right. It will show you all objects   
   > : where "Right" is defined.   
   >   
   > Thanks!   
   >   
   > Writing 'Print VBA.Strings.Right("123456", 2)' works but looking in the   
   > object browser 'left' is defined in the library 'Unknown3' but 'right' is   
   > not defined at all! If I open a new project 'right' works. What could be   
   > done?   
      
   Hmm... If VBA.Strings.Right() would not have worked either and you find   
   no definition of Right() in the object browser I would have suggested to   
   check if the VBA library is referenced correctly, but now when   
   VBA.Strings.Right() works I do not know really...   
      
   If you look in Project -> References in the project where Right() does   
   not work, is the same "Visual Basic For Applications" library referenced   
   there as it is in a new project? If not, select the same VBA library as   
   you get for new projects. (This could be a bit tricky, you may have to   
   edit the object references in the .vbp file manually.)   
      
   --   
   Olof Lagerkvist   
   ICQ: 724451   
   Web page: http://here.is/olof   
      
   --- 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