views:

43

answers:

1

I have a bunch of Realbasic code that was written on a Mac that I'm supposed to port to Windows. Right now let's just try to get the program running from within REAL Studio. GetFolderItem("") returns the folder the application is in. Child("A") returns another FolderItem how I would expect. But when I call Child("B") on A it returns a FolderItem with False set for the Directory property. But B is a folder on my Windows! So now it won't let me get a Child of B, it just returns nil. This code worked fine on MacOSX. Any suggestions?

Thanks in advance, Me

+2  A: 

I suspect you're not in the directory that you think you are. Try looking at the path in the debugger to see if the debugger is looking in the same place you are.

It's a common issue when dealing with Mac vs Windows in RB. On the Mac, many things are placed in the bundle folder so that there are no external files/directories and since Windows has no equivalent, people get confused as to what path they're in.

BTW, you don't need to use GetFolderItem("") first. You can simply use GetFolderItem("A") because you're it defaults to the directory the App is in.

BKeeney Software
I figured this out a second after I posted it. But good for BKeeney for getting it right. I thought I was in the folder the RealBasicProject file was in. In my hasty debugging I didn't realize that I was actually in a temporarily created Debugging folder that disappeared after debugging finished.
Brad
Common mistake that I've done plenty of times myself. ;)
BKeeney Software