Hi - I'm having trouble passing strings which may be empty (or may not be!) to my own function. I'm currently trying to walk up and down a file structure, but a simpler example might be:
// --------------------------------- //
// Project: PassValuesToFunction
// Start: Monday, August 21, 2023
// IDE Version: 16.793
// SETCURRENTDIR("Media") // go to media files
LOCAL workpath$, str_Temp$ = ""
workpath$ = "C://"
SearchFolder(workpath$, str_Temp$, str_Temp$, 0)
// ------------------------------------------------------------- //
// --- SEARCHFOLDER ---
// ------------------------------------------------------------- //
FUNCTION SearchFolder: strPath$, strParentFolder$, strFileEntry$, numDepth%
// These values are defined LOCAL:
// strPath$, strParentFolder$, strFileEntry$, numDepth%
DEBUG strFileEntry$
ENDFUNCTION // SEARCHFOLDER
When I run that code I never get an empty string in strParentFolder$ or strFileEntry$ = I get what look like random characters (see the attached screen capture)?
Help, anyone?
BTW the forum suggests that the current steam version is 16.026, while I have IDE Version 16.793? Are GLB and GLB's IDE on different version numbers?
Cheers,
Cliff
I think it's just a problem in debugging mode.
if you add a line like:
debug LEN(strFileEntry$)+"\n" you will see the result is 0
Oh. I'll take a look at this one. Sorry.
Quote from: Qedo on 2023-Aug-22I think it's just a problem in debugging mode.
if you add a line like:
debug LEN(strFileEntry$)+"\n" you will see the result is 0
Wow - many thanks for this. I believe in my project I have started passing the length of the string as an extra variable, so I can check that for 0 instead of checking the string for "".
Sorry for the delay in responding - I didn't get an email notification... but MANY thanks for your reply.
Cheers,
Cliff
Quote from: Kitty Hello on 2023-Aug-23Oh. I'll take a look at this one. Sorry.
Nah, I'm sorry. Whenever I get back to GLBasic I seem to find "issues". But this is not unique to GLBasic - I just find problems everywhere I go!
I'm currently extremely anemic after a 7 unit blood transfusion earlier in the year - and i'm using the lack of iron in my blood as an excuse for wooly thinking :)
Cheers,
Cliff
Can't reproduce it. :|
Quote from: Cliff3D on 2023-Aug-21BTW the forum suggests that the current steam version is 16.026, while I have IDE Version 16.793? Are GLB and GLB's IDE on different version numbers?
Fixed, thx for the hint.