The "filesystem" and "file" controls are no longer supported - I think that this might be where your problem gets started. Take a look at this tutorial for some intro to the newer filesystem and file objects: http://www.nsbasic.com/ce/info/technotes/TT06.htm
The ListBox1.AddItem line should definitely work, without needing another routine or method call. I'd suggest a few general troubleshooting tips: - Comment out or remove the code that's not really relevant to what you're trying to do, to see if it's interfering - Use msgbox to test and see what code is being run through - Do NOT use on error resume next at all while something that you expect to happen is not happening, like in this case. --- In [email protected], "georgeewalters" <gwalt...@...> wrote: > > > Yes, that stuff is in the program > > AddObject "filesystem" > AddObject "file" > > even if I do this, ignoring the file reads I still get nothing in the list box > > ListBox1.AddItem "bunch of junk stuff" > > Do I need something like Sub ListBox1_Load ?? > > > --- In [email protected], "chris_kenworthy" <chrisken0@> wrote: > > > > First question - is there any other code or setup in the program regarding > > the File control? There isn't a built-in one in NSbasic - you need to do an > > AddObject line or something similar. > > > > Also, if you're not going to do any more error checking, then you should > > probably add an 'On Error Goto 0' line after the End If in Init - otherwise > > there could be a cascade of error conditions and no notifications about > > them at all. > > > > Hope that this helps. > > > > --- In [email protected], "georgeewalters" <gwalters@> wrote: > > > > > > Newbee (old returning) trying to load a list box when initing the program. > > > > > > Sub Form1_Load > > > > > > Description.UppercaseOnly = True > > > Description2.UppercaseOnly = True > > > ItemNbr.SetFocus > > > Keyboardstatus = 1 > > > Init > > > > > > End Sub > > > > > > Sub Init > > > > > > On Error Resume Next > > > file.Open "\My Documents\pdaPickList.txt",4,1,3,118 'input, direct, > > > locked, reclen > > > If err.number > 0 Then > > > MsgBox("Can't open pdaPickList") > > > On Error Goto 0 > > > Exit Sub > > > End If > > > file.Get fileRec, 1 > > > > > > '-- build list box text > > > tmp = left(fileRec(1,6) & space(7),7) > > > tmp = tmp & left(ucase(fileRec(7,25)) & space(25),25) > > > > > > > > > ListBox1.AddItem tmp > > > > > > End Sub > > > > > > Problem is that there is nothing in the list box. What am I doing wrong? > > > > > > -- You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en.
