Author Topic: Bug report: PLATFORMINFO$ (DEBUGGER BUG?)  (Read 3859 times)

Offline MCP

  • Mc. Print
  • *
  • Posts: 8
    • View Profile
Hi folks,

I'm new to GLBasic and these forums so I'm sad to report that PLATFORMINFO$ doesn't seem to work as implied in the documentation and will only return empty strings regardless of whatever parameter I pass to it. I have the latest GLBasic version of 10.283 and I have GLBasic installed on Win7 (32bit).

Here's my code snippet for you to look at just in case it's me that's doing something wrong...
Code: (glbasic) [Select]
// --------------------------------- //
// Project: TestApp
// Start: Tuesday, January 01, 2013
// IDE Version: 10.283
GLOBAL gPlatform$
GLOBAL gSavePath$
GLOBAL gDocsPath$
GLOBAL gTempPath$
gPlatform$=PLATFORMINFO$("")
gSavePath$=PLATFORMINFO$("APPDATA")
gDocsPath$=PLATFORMINFO$("DOCUMENTS")
gTempPath$=PLATFORMINFO$("TEMP")

Any help would be very much appreciated. Thanks.
« Last Edit: 2013-Jan-23 by Ian Price »

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4176
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Bug report: PLATFORMINFO$
« Reply #1 on: 2013-Jan-23 »
Eh? Sorry I've just got home after a Night shift and have been up for over 24 hours now, so my brain might be a bit muddled.

Code: (glbasic) [Select]
GLOBAL gPlatform$
GLOBAL gSavePath$
GLOBAL gDocsPath$
GLOBAL gTempPath$
gPlatform$=PLATFORMINFO$("")
gSavePath$=PLATFORMINFO$("APPDATA")
gDocsPath$=PLATFORMINFO$("DOCUMENTS")
gTempPath$=PLATFORMINFO$("TEMP")

PRINT gSavePath$,10,10
PRINT gDocsPath$,10,20
        PRINT gTempPath$,10,30

SHOWSCREEN

KEYWAIT

They all perform exactly as I would expect. You don't pass strings TO them, you get strings FROM them to use to do various things.

What exactly are you trying to achieve?
I came. I saw. I played.

Offline MCP

  • Mc. Print
  • *
  • Posts: 8
    • View Profile
Re: Bug report: PLATFORMINFO$
« Reply #2 on: 2013-Jan-23 »
Hi Ian,

Thanks for your reply. I've tested your code snippet and it works fine for me too.
Previously I'd set a breakpoint pretty much where your PRINT statement would be and the debugger falsely reports the strings returned as empty. I think the bug report still stands although it seems to be a debugging issue.

Thanks for your help.

Offline hardyx

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 505
    • View Profile
Re: Bug report: PLATFORMINFO$
« Reply #3 on: 2013-Jan-23 »
If you don't use a variable, the compiler (GCC) can optimize the code and eliminate the variable calculation.

MrTAToad

  • Guest
Re: Bug report: PLATFORMINFO$
« Reply #4 on: 2013-Jan-23 »
Yes, it does seem that the debugger is displaying empty text (when it shouldn't) :



[attachment deleted by admin]
« Last Edit: 2013-Jan-23 by MrTAToad »

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4176
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Bug report: PLATFORMINFO$ (DEBUGGER BUG?)
« Reply #5 on: 2013-Jan-23 »
I've edited the title, as it does indeed appear to be an issue with the debugger alone and not a general bug which the original post appeared to indicate.
I came. I saw. I played.

MrTAToad

  • Guest
Re: Bug report: PLATFORMINFO$ (DEBUGGER BUG?)
« Reply #6 on: 2013-Jan-24 »
Yes, its rather an odd problem...

Offline hardyx

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 505
    • View Profile
Re: Bug report: PLATFORMINFO$
« Reply #7 on: 2013-Jan-24 »
Yes, it does seem that the debugger is displaying empty text (when it shouldn't) :
In my GLB version 10.283 works ok the debugger. ┬┐Do you use the v11?

MrTAToad

  • Guest
Re: Bug report: PLATFORMINFO$ (DEBUGGER BUG?)
« Reply #8 on: 2013-Jan-24 »
Yes, forgot to mention that...  Must be a newly acquired bug :)

Offline MCP

  • Mc. Print
  • *
  • Posts: 8
    • View Profile
Re: Bug report: PLATFORMINFO$ (DEBUGGER BUG?)
« Reply #9 on: 2013-Jan-24 »
Yes, forgot to mention that...  Must be a newly acquired bug :)
The bug is present in version 10.283.

MrTAToad

  • Guest
Re: Bug report: PLATFORMINFO$ (DEBUGGER BUG?)
« Reply #10 on: 2013-Jan-25 »
Indeed it is!